Skip to content

Commit

Permalink
gist ID undefined check
Browse files Browse the repository at this point in the history
  • Loading branch information
shanalikhan committed Apr 23, 2016
1 parent 76966c9 commit d1f3161
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "code-settings-sync",
"displayName": "Visual Studio Code Settings Sync",
"description": "Synchronize Settings, Snippets, launch, keybindings files and extensions Across Multiple Machines using Github GIST.",
"version": "1.1.7",
"version": "1.1.8",
"icon": "images/cloud.png",
"publisher": "Shan",
"author": {
Expand All @@ -22,7 +22,7 @@
"email": "[email protected]"
},
"engines": {
"vscode": "^0.10.9"
"vscode": "^1.0.0"
},
"categories": [
"Other"
Expand Down
15 changes: 9 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export function activate(context: vscode.ExtensionContext) {
});


if (sett.Gist == null || sett.Gist == "") {
if (sett.Gist == null || sett.Gist === "") {
await myGi.CreateNewGist(allSettingFiles).then(async function(gistID: string) {
sett.Gist = gistID;

await common.SaveSettings(sett).then(function(added: boolean) {
if (gistID) {
sett.Gist = gistID;
await common.SaveSettings(sett).then(function(added: boolean) {
if (added) {
vscode.window.showInformationMessage("Uploaded Successfully." + " GIST ID : " + gistID + " . Please copy and use this ID in other machines to sync all settings.");
vscode.window.setStatusBarMessage("Gist Saved.", 1000);
Expand All @@ -146,8 +146,11 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
return;
});


}
else{
vscode.window.showErrorMessage("GIST ID: undefined" + common.ERROR_MESSAGE);
return;
}
}, function(error: any) {
vscode.window.showErrorMessage(common.ERROR_MESSAGE);
return;
Expand Down

0 comments on commit d1f3161

Please sign in to comment.