|
@@ -1,11 +1,8 @@
|
|
|
-import { t } from "../translations";
|
|
|
import { scriptInfo, host } from "../constants";
|
|
|
import { getFeatures } from "../config";
|
|
|
-import { error, info, sendRequest } from "../utils";
|
|
|
+import { error, info, sendRequest, t } from "../utils";
|
|
|
+import { getVersionNotifDialog } from "../dialogs";
|
|
|
import pkg from "../../package.json" assert { type: "json" };
|
|
|
-// import { BytmMenu } from "src/menu/new/BytmMenu";
|
|
|
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
|
-import React from "react";
|
|
|
|
|
|
const releaseURL = "https://github.com/Sv443/BetterYTM/releases/latest";
|
|
|
|
|
@@ -41,30 +38,8 @@ export async function checkVersion() {
|
|
|
openuserjs: "OpenUserJS",
|
|
|
};
|
|
|
|
|
|
- // const menu = new BytmMenu({
|
|
|
- // id: "version-check",
|
|
|
- // closeOnBgClick: false,
|
|
|
- // closeOnEscPress: false,
|
|
|
- // renderBody() {
|
|
|
- // return (
|
|
|
- // <div>
|
|
|
- // <p>
|
|
|
- // {t("new_version_available", scriptInfo.name, scriptInfo.version, latestTag, platformNames[host])}
|
|
|
- // </p>
|
|
|
- // <button
|
|
|
- // className="bytm-btn"
|
|
|
- // onClick={() => window.open(pkg.updates[host])}
|
|
|
- // >
|
|
|
- // {t("update_now")}
|
|
|
- // </button>
|
|
|
- // </div>
|
|
|
- // );
|
|
|
- // },
|
|
|
- // });
|
|
|
-
|
|
|
- // menu.on("close", () => menu.destroy());
|
|
|
-
|
|
|
- // await menu.open();
|
|
|
+ const dialog = getVersionNotifDialog({ latestTag });
|
|
|
+ await dialog.open();
|
|
|
|
|
|
// TODO: replace with custom dialog
|
|
|
if(confirm(t("new_version_available", scriptInfo.name, scriptInfo.version, latestTag, platformNames[host])))
|