[MM-60080] Fixed the MAS migration from the DMG build, fixed a potential crash case (#3186)
* [MM-60080] Fixed the MAS migration from the DMG build, fixed a potential crash case * Merge'd
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user