mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
⬆️ migrate tauri-rc
This commit is contained in:
@@ -43,7 +43,7 @@ let themeListener: UnlistenFn;
|
||||
let urlListener: UnlistenFn;
|
||||
|
||||
onBeforeMount(async () => {
|
||||
const win = webviewWindow.getCurrent();
|
||||
const win = webviewWindow.getCurrentWebviewWindow();
|
||||
isMain.value = win.label === "TeyvatGuide";
|
||||
if (isMain.value) {
|
||||
const title = "Teyvat Guide v" + (await app.getVersion()) + " Beta";
|
||||
@@ -66,7 +66,7 @@ async function checkResize(): Promise<void> {
|
||||
});
|
||||
return;
|
||||
}
|
||||
const windowCur = await webviewWindow.getCurrent();
|
||||
const windowCur = await webviewWindow.getCurrentWebviewWindow();
|
||||
if (await windowCur.isMaximized()) return;
|
||||
const designSize = getSize(windowCur.label);
|
||||
const widthScale = screen.size.width / 1920;
|
||||
|
||||
@@ -301,7 +301,7 @@ onMounted(async () => {
|
||||
const theme = e.payload;
|
||||
themeGet.value = theme === "default" ? "default" : "dark";
|
||||
});
|
||||
if (webviewWindow.getCurrent().label === "TeyvatGuide") {
|
||||
if (webviewWindow.getCurrentWebviewWindow().label === "TeyvatGuide") {
|
||||
await mhyClient.run();
|
||||
}
|
||||
if (userStore.briefInfo.value && userStore.briefInfo.value.nickname) {
|
||||
|
||||
@@ -75,7 +75,9 @@ onMounted(async () => {
|
||||
annoHtml.value = await TGUtils.Anno.parseContent(annoData.value.content);
|
||||
if (annoData.value.banner !== "") annoBanner.value = await saveImgLocal(annoData.value.banner);
|
||||
annoTitle.value = `Anno_${annoId}`;
|
||||
await webviewWindow.getCurrent().setTitle(`Anno_${annoId} ${annoData.value.title}`);
|
||||
await webviewWindow
|
||||
.getCurrentWebviewWindow()
|
||||
.setTitle(`Anno_${annoId} ${annoData.value.title}`);
|
||||
annoRef.value = <HTMLElement>document.querySelector(".anno-body");
|
||||
} catch (error) {
|
||||
if (error instanceof Error)
|
||||
@@ -83,7 +85,7 @@ onMounted(async () => {
|
||||
else console.error(error);
|
||||
loadingEmpty.value = true;
|
||||
loadingTitle.value = "公告不存在或解析失败";
|
||||
await webviewWindow.getCurrent().setTitle(`Anno_${annoId} Parsing Error`);
|
||||
await webviewWindow.getCurrentWebviewWindow().setTitle(`Anno_${annoId} Parsing Error`);
|
||||
return;
|
||||
}
|
||||
// 打开 json
|
||||
|
||||
@@ -136,7 +136,7 @@ onMounted(async () => {
|
||||
if (!postId) {
|
||||
loadingEmpty.value = true;
|
||||
loadingTitle.value = "未找到数据";
|
||||
await webviewWindow.getCurrent().setTitle("未找到数据");
|
||||
await webviewWindow.getCurrentWebviewWindow().setTitle("未找到数据");
|
||||
await TGLogger.Error("[t-post][onMounted] PostID 不存在");
|
||||
return;
|
||||
}
|
||||
@@ -147,7 +147,9 @@ onMounted(async () => {
|
||||
loadingTitle.value = "正在渲染数据...";
|
||||
renderPost.value = getRenderPost(postData.value);
|
||||
shareTitle.value = `Post_${postId}`;
|
||||
await webviewWindow.getCurrent().setTitle(`Post_${postId} ${postData.value.post.subject}`);
|
||||
await webviewWindow
|
||||
.getCurrentWebviewWindow()
|
||||
.setTitle(`Post_${postId} ${postData.value.post.subject}`);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
await TGLogger.Error(`[t-post][${postId}] ${error.name}: ${error.message}`);
|
||||
@@ -159,7 +161,7 @@ onMounted(async () => {
|
||||
loadingSub.value = "请检查帖子是否存在或者是否为合法的帖子";
|
||||
}
|
||||
loadingEmpty.value = true;
|
||||
await webviewWindow.getCurrent().setTitle(`Post_${postId} Parsing Error`);
|
||||
await webviewWindow.getCurrentWebviewWindow().setTitle(`Post_${postId} Parsing Error`);
|
||||
return;
|
||||
}
|
||||
await TGLogger.Info(`[t-post][${postId}][onMounted] ${postData.value.post.subject}`);
|
||||
|
||||
Reference in New Issue
Block a user