Skip to content

Commit

Permalink
oh, just put it in the module
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Nov 8, 2024
1 parent 835f39c commit 97945e0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
17 changes: 17 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,23 @@ import "../src/global-css";
import "../src/test-prep";
import "../src/base.css";

if (typeof window !== "undefined") {
// @ts-expect-error
Promise.prototype.finally = function (callback) {
debugger;
this.then(
result => {
callback && callback();
return result;
},
result => {
callback && callback();
throw result;
}
);
};
}

interface AuthProps {
apiKey?: string;
}
Expand Down
20 changes: 0 additions & 20 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import crypto from "crypto";
import * as Sentry from "@sentry/browser";
import Document, { Head, Html, Main, NextScript } from "next/document";
import Script from "next/script";
import React from "react";

import { setErrorHandler } from "protocol/utils";
Expand Down Expand Up @@ -65,25 +64,6 @@ export default class MyDocument extends Document {
<meta httpEquiv="Content-Security-Policy" content={csp(this.props)} />
<link rel="stylesheet" href="/recording/fonts/inter/inter.css" />
<link rel="stylesheet" href="/recording/fonts/material_icons/material_icons.css" />
<Script
dangerouslySetInnerHTML={{
__html: `(${function () {
// @ts-expect-error
Promise.prototype.finally = function (callback) {
this.then(
result => {
callback && callback();
return result;
},
result => {
callback && callback();
throw result;
}
);
};
}.toString()})()`,
}}
></Script>
</Head>
<body>
<Main />
Expand Down

0 comments on commit 97945e0

Please sign in to comment.