Skip to content

Commit

Permalink
[MM-60080] Fixed the MAS migration from the DMG build, fixed a potent…
Browse files Browse the repository at this point in the history
…ial crash case (#3186)

* [MM-60080] Fixed the MAS migration from the DMG build, fixed a potential crash case

* Merge'd
  • Loading branch information
devinbinnie authored Nov 4, 2024
1 parent ebbee6d commit 03dcd86
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/app/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ describe('main/app/utils', () => {
dialog.showMessageBoxSync.mockReturnValue(0);
dialog.showOpenDialogSync.mockReturnValue(['/old/data/path']);
migrateMacAppStore();
expect(fs.cpSync).toHaveBeenCalledWith('/old/data/path', '/path/to/data');
expect(fs.cpSync).toHaveBeenCalledWith('/old/data/path', '/path/to/data', {recursive: true});
expect(updatePaths).toHaveBeenCalled();
expect(migrationPrefs.setValue).toHaveBeenCalledWith('masConfigs', true);
});
Expand Down
2 changes: 1 addition & 1 deletion src/main/app/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export function migrateMacAppStore() {
}

try {
fs.cpSync(result[0], app.getPath('userData'));
fs.cpSync(result[0], app.getPath('userData'), {recursive: true});
updatePaths(true);
migrationPrefs.setValue('masConfigs', true);
} catch (e) {
Expand Down
1 change: 1 addition & 0 deletions src/main/developerMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export class DeveloperMode extends EventEmitter {

let developerMode = new DeveloperMode(developerModeJson);
ipcMain.on(UPDATE_PATHS, () => {
ipcMain.removeHandler(IS_DEVELOPER_MODE_ENABLED);
developerMode = new DeveloperMode(developerModeJson);
});
export default developerMode;
3 changes: 3 additions & 0 deletions src/main/permissionsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ t('main.permissionsManager.checkPermission.dialog.detail.screenShare');
let permissionsManager = new PermissionsManager(permissionsJson);

ipcMain.on(UPDATE_PATHS, () => {
ipcMain.removeAllListeners(OPEN_WINDOWS_CAMERA_PREFERENCES);
ipcMain.removeAllListeners(OPEN_WINDOWS_MICROPHONE_PREFERENCES);
ipcMain.removeHandler(GET_MEDIA_ACCESS_STATUS);
permissionsManager = new PermissionsManager(permissionsJson);
});

Expand Down

0 comments on commit 03dcd86

Please sign in to comment.