Skip to content

Commit 7336db7

Browse files
committed
修复老脚本没selfMetadata报错的bug
1 parent 22f9c1b commit 7336db7

File tree

7 files changed

+13
-6
lines changed

7 files changed

+13
-6
lines changed

build/scriptcat/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "ScriptCat",
4-
"version": "0.6.0",
4+
"version": "0.6.1",
55
"description": "脚本猫,一个用户脚本的框架,可编写脚本每天帮你自动处理事务.",
66
"background": {
77
"page": "background.html"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scriptcat",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"description": "脚本猫,一个可以执行用户脚本的浏览器扩展,万物皆可脚本化,让你的浏览器可以做更多的事情!",
55
"scripts": {
66
"test": "jest",

src/apps/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export const ExtVersion = "0.6.0";
1+
export const ExtVersion = "0.6.1";
22

33
export const Server = process.env.NODE_ENV == "production" ? "https://sc.icodef.com/" : "http://localhost:8080/";

src/apps/script/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class ScriptController {
326326

327327
// 自定义配置
328328
for (const key in ret.metadata) {
329-
if (ret.selfMetadata[key]) {
329+
if (ret.selfMetadata && ret.selfMetadata[key]) {
330330
ret.metadata[key] = ret.selfMetadata[key];
331331
}
332332
}

src/apps/script/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ export class ScriptManager {
935935
script.runStatus = (<Script>old).runStatus;
936936
}
937937
script.sort = sync.sort;
938-
script.selfMetadata = JSON.parse(sync.self_meta);
938+
script.selfMetadata = JSON.parse(sync.self_meta) || {};
939939
script.createtime = sync.createtime;
940940
script.updatetime = sync.updatetime;
941941
script.subscribeUrl = sync.subscribe_url

src/apps/script/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function copyScript(script: Script, old: Script) {
102102
script.delayruntime = old.delayruntime;
103103
script.error = old.error;
104104
script.sort = old.sort;
105-
script.selfMetadata = old.selfMetadata;
105+
script.selfMetadata = old.selfMetadata || {};
106106
for (let key in script.selfMetadata) {
107107
script.metadata[key] = script.metadata[key];
108108
}

src/views/components/UserMenu.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
</v-avatar>
1818
<h3 style="margin-top: 10px">{{ user.username }}</h3>
1919
<div v-if="user.islogin">
20+
<v-divider class="my-3"></v-divider>
21+
<v-btn depressed rounded text @click="userInfo">个人设置</v-btn>
2022
<v-divider class="my-3"></v-divider>
2123
<v-btn depressed rounded text @click="logout">注销</v-btn>
2224
</div>
@@ -67,5 +69,10 @@ export default class Snackbar extends Vue {
6769
logout() {
6870
userModule.logout();
6971
}
72+
73+
userInfo() {
74+
window.open(Server + "account/settings");
75+
}
76+
7077
}
7178
</script>

0 commit comments

Comments
 (0)