Minor refactoring

This commit is contained in:
a 2020-08-12 00:23:14 +02:00
parent 57ec8ac956
commit 1c4ea56865
3 changed files with 4 additions and 8 deletions

View file

@ -1,7 +1,4 @@
import { browser } from "webextension-polyfill-ts"; import { browser } from "webextension-polyfill-ts";
declare interface Window {
hasRun: boolean;
}
(async () => { (async () => {
if (window.location.host != "translate.google.com" || window.hasRun) return; if (window.location.host != "translate.google.com" || window.hasRun) return;

View file

@ -4,11 +4,6 @@ import App from "./Translate.svelte";
import "tippy.js/dist/tippy.css"; import "tippy.js/dist/tippy.css";
import "./tippy.scss"; import "./tippy.scss";
declare global {
interface Window {
hasRun: any;
}
}
(() => { (() => {
//Make sure our script only runs once //Make sure our script only runs once
if (window.hasRun) return; if (window.hasRun) return;

4
src/types.d.ts vendored
View file

@ -15,3 +15,7 @@ declare interface Flashcard {
dateAdded: Date; dateAdded: Date;
exported: boolean; exported: boolean;
} }
declare interface Window {
hasRun: any;
}