Skip to content

Commit dc20472

Browse files
authored
Merge pull request #11 from neet/integrated-model
モデル統合 & #9 のパッチ
2 parents c66505c + 8b9522f commit dc20472

18 files changed

+122
-117
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ out
22
node_modules
33
.vscode-test/
44
*.vsix
5+
storage

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ src/**
77
tsconfig.json
88
vsc-extension-quickstart.md
99
tslint.json
10+
storage

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"core-js": "^2.5.7",
2828
"mocha": "^5.2.0",
2929
"npm-run-all": "^4.1.3",
30-
"qiita-js-2": "^1.3.0",
30+
"qiita-js-2": "^1.3.1",
3131
"tslint": "^5.8.0",
3232
"typescript": "^3.0.3",
3333
"vscode": "^1.1.6",
@@ -83,7 +83,7 @@
8383
},
8484
{
8585
"command": "qiita.expandItems",
86-
"title": "%commands.expanditems.title%",
86+
"title": "%commands.expandItems.title%",
8787
"category": "Qiita"
8888
}
8989
],

package.nls.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"commands.editTitle.title": "タイトルを編集",
3838
"commands.editTitle.success": "タイトルを編集しました",
3939

40-
"commands.expanditems.title": "さらに読み込む...",
40+
"commands.expandItems.title": "さらに読み込む...",
4141

4242
"quickpicks.tagQuickPick.title": "投稿に登録するタグを入力してください",
4343
"quickpicks.tagQuickPick.placeholder": "例) Rails React Mastodon",

src/commands/compose.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export async function compose (resource?: Uri) {
8484

8585
try {
8686
const item = await client.createItem(options);
87-
qiitaItemsProvider.refresh();
87+
await qiitaItemsProvider.refreshItems();
8888

8989
const openInBrowser = localize(
9090
'commands.compose.openInBrowser',

src/commands/deleteItem.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function deleteItem (resource: { item: Item }) {
3535

3636
try {
3737
await client.deleteItem(resource.item.id);
38-
qiitaItemsProvider.refresh();
38+
await qiitaItemsProvider.refreshItems();
3939

4040
return window.showInformationMessage(localize(
4141
'commands.deleteItem.success',

src/commands/editTags.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export async function editTags (resource: { item: Item }) {
4848
try {
4949
quickPick.hide();
5050
await updater(item, quickPick.selectedItems);
51-
qiitaItemsProvider.refresh();
51+
await qiitaItemsProvider.refreshItems();
5252

5353
return window.showInformationMessage(localize(
5454
'commands.editTags.success',

src/commands/editTitle.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ export function editTitle (resource: { item: Item }) {
2626

2727
try {
2828
inputBox.hide();
29+
2930
await client.updateItem(item.id, {
3031
body: item.body,
3132
tags: item.tags,
3233
title: inputBox.value,
3334
});
34-
qiitaItemsProvider.refresh();
35+
36+
await qiitaItemsProvider.refreshItems();
3537

3638
return window.showInformationMessage(localize(
3739
'commands.editTitle.success',

src/commands/expandItems.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { qiitaItemsProvider } from '../explorers/qiitaItems';
2-
import { itemsStore } from '../stores/itemsStore';
2+
import { handleErrorMessage } from '../utils/errorHandler';
33

44
export async function expandItems () {
5-
if (!itemsStore.done) {
6-
await itemsStore.expandItems();
7-
qiitaItemsProvider.refresh();
5+
try {
6+
if (!qiitaItemsProvider.done) {
7+
await qiitaItemsProvider.expandItems();
8+
}
9+
} catch (error) {
10+
handleErrorMessage(error);
811
}
912
}

src/commands/makePublic.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export async function makePublic (resource: { item: Item }) {
4747
tags: resource.item.tags,
4848
private: false,
4949
});
50-
qiitaItemsProvider.refresh();
50+
51+
await qiitaItemsProvider.refreshItems();
5152

5253
return window.showInformationMessage(localize(
5354
'commands.makePublic.success',

0 commit comments

Comments
 (0)