MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / openUpdatePage

Method openUpdatePage

src/app/service/service_worker/script.ts:994–1011  ·  view source on GitHub ↗
(script: Script, source: "user" | "system")

Source from the content-addressed store, hash-verified

992
993 // 打开更新窗口
994 public async openUpdatePage(script: Script, source: "user" | "system") {
995 const { uuid, name, downloadUrl, checkUpdateUrl } = script;
996 const logger = this.logger.with({
997 uuid,
998 name,
999 downloadUrl,
1000 checkUpdateUrl,
1001 });
1002 const url = downloadUrl || checkUpdateUrl!;
1003 try {
1004 const ret = await this.openUpdateOrInstallPage(uuid, url, { source }, true, logger);
1005 if (ret === 2) return; // slience update
1006 // 打开安装页面
1007 openInCurrentTab(`/src/install.html?uuid=${uuid}`);
1008 } catch (e) {
1009 logger.error("fetch script info failed", Logger.E(e));
1010 }
1011 }
1012
1013 async openBatchUpdatePage(opts: TOpenBatchUpdatePageOption) {
1014 const { q, dontCheckNow } = opts;

Callers 2

requestCheckUpdateMethod · 0.95
openUpdatePageByUUIDMethod · 0.95

Calls 5

openInCurrentTabFunction · 0.90
withMethod · 0.80
errorMethod · 0.80
EMethod · 0.80

Tested by

no test coverage detected