Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
shanalikhan committed Apr 3, 2019
1 parent 691c229 commit 57b4bae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
23 changes: 11 additions & 12 deletions src/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,8 @@ export default class Commons {
const customSettingStr: string = await FileService.ReadFile(
this.en.FILE_CUSTOMIZEDSETTINGS
);
const tempObj: {
[key: string]: any;
ignoreUploadSettings: string[];
} = JSON.parse(customSettingStr);
if (!Array.isArray(tempObj.ignoreUploadSettings)) {
tempObj.ignoreUploadSettings = [];
}
const tempObj = JSON.parse(customSettingStr);

Object.assign(customSettings, tempObj);
customSettings.token = customSettings.token.trim();
return customSettings;
Expand All @@ -180,13 +175,9 @@ export default class Commons {

public async SetCustomSettings(setting: CustomSettings): Promise<boolean> {
try {
const json: { [key: string]: any; ignoreUploadSettings: string[] } = {
...setting
};
delete json.ignoreUploadSettings;
await FileService.WriteFile(
this.en.FILE_CUSTOMIZEDSETTINGS,
JSON.stringify(json, null, 4)
JSON.stringify(setting, null, 4)
);
return true;
} catch (e) {
Expand Down Expand Up @@ -234,6 +225,14 @@ export default class Commons {
});
} else if (customSettings.version < Environment.CURRENT_VERSION) {
fileChanged = true;
// #TODO : Remove this in new update
const newIgnoredList = new CustomSettings().ignoreUploadFiles;
newIgnoredList.forEach(m => {
if (customSettings.ignoreUploadFiles.indexOf(m) === -1) {
customSettings.ignoreUploadFiles.push(m);
}
});

if (this.context.globalState.get("synctoken")) {
const token = this.context.globalState.get("synctoken");
if (token !== "") {
Expand Down
1 change: 0 additions & 1 deletion src/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export class CustomSettings {
];
public ignoreUploadFolders: string[] = ["workspaceStorage"];
public ignoreExtensions: string[] = [];
public ignoreUploadSettings: string[] = [];
public gistDescription: string = "Visual Studio Code Settings Sync Gist";
public version: number = Environment.CURRENT_VERSION;
public token: string = "";
Expand Down
2 changes: 0 additions & 2 deletions src/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ export class Sync {
localConfig.customConfig.token,
localConfig.customConfig.githubEnterpriseUrl
);
// ignoreSettings = await common.GetIgnoredSettings(localConfig.customConfig.ignoreUploadSettings);
await startGitProcess(localConfig.extConfig, localConfig.customConfig);
// await common.SetIgnoredSettings(ignoreSettings);
} catch (error) {
Commons.LogException(error, globalCommonService.ERROR_MESSAGE, true);
return;
Expand Down

0 comments on commit 57b4bae

Please sign in to comment.