Skip to content

Commit

Permalink
feat: 侧边栏添加空态视图
Browse files Browse the repository at this point in the history
  • Loading branch information
aooiuu committed Apr 1, 2024
1 parent da0ee9a commit 17ca399
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
22 changes: 20 additions & 2 deletions packages/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "any-reader",
"description": "any-reader for vscode",
"icon": "resources/icon.png",
"version": "0.5.3",
"version": "0.5.4",
"preview": true,
"publisher": "aooiu",
"qna": "https://github.com/aooiuu/any-reader/issues",
Expand Down Expand Up @@ -190,7 +190,25 @@
"group": "inline"
}
]
}
},
"viewsWelcome": [
{
"view": "any-reader-source",
"contents": "[如何添加规则](https://aooiuu.github.io/any-reader/vsc/#%E9%85%8D%E7%BD%AE%E8%A7%84%E5%88%99)\n[提建议 | 提BUG](https://github.com/aooiuu/any-reader/issues)"
},
{
"view": "any-reader-book",
"contents": "搜索或者查看章节列表后数据会出现在这里 \n[使用文档](https://aooiuu.github.io/any-reader/vsc/)\n[提建议 | 提BUG](https://github.com/aooiuu/any-reader/issues)"
},
{
"view": "any-reader-history",
"contents": "阅读历史记录, 查看章节后会书籍会出现在这里"
},
{
"view": "any-reader-favorites",
"contents": "收藏列表, 您还没有收藏书籍"
}
]
},
"devDependencies": {
"@types/fs-extra": "^11.0.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/vscode/src/utils/RecordFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class RecordFile {
// 初始化
async init() {
await fs.ensureFile(this.filePath);
this.history = await fs.readJson(this.filePath).catch(() => []);
this.history = await fs.readJson(this.filePath).catch(() => this.history);
}

// 获取所有记录
Expand All @@ -30,7 +30,7 @@ export class RecordFile {
// 保存配置文件
async writeFile() {
await fs.ensureFile(this.filePath);
return fs.writeJson(this.filePath, this.history, { spaces: 2 });
await fs.writeJson(this.filePath, this.history, { spaces: 2 });
}

// 删除记录
Expand Down
1 change: 0 additions & 1 deletion packages/vscode/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"module": "commonjs",
"target": "ES2020",
"lib": ["ES2020"],
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "any-reader-web",
"version": "0.5.0",
"version": "0.5.4",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/pages/discover/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<div
class="star invisible absolute top-5 right-5 px-2 py-2 rounded-10 bg-[#000000cc] flex items-center justify-center"
@click="favoritesStore.star(row, ruleId)"
@click.stop="favoritesStore.star(row, ruleId)"
>
<icon-star-fill v-if="favoritesStore.starred(row, ruleId)" :size="14" />
<icon-star v-else :size="14" />
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/pages/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<div
class="star invisible absolute top-5 right-5 px-2 py-2 rounded-10 bg-[#000000cc] flex items-center justify-center"
@click="favoritesStore.star(row, item.rule.id)"
@click.stop="favoritesStore.star(row, item.rule.id)"
>
<icon-star-fill v-if="favoritesStore.starred(row, item.rule.id)" :size="14" />
<icon-star v-else :size="14" />
Expand Down

0 comments on commit 17ca399

Please sign in to comment.