Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading