Skip to content

Commit 9b94007

Browse files
committed
Provide whether or not macOS 13 or newer to renderer
1 parent dd8ca73 commit 9b94007

File tree

8 files changed

+34
-1
lines changed

8 files changed

+34
-1
lines changed

Diff for: gui/src/main/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import NotificationController, {
5555
NotificationControllerDelegate,
5656
NotificationSender,
5757
} from './notification-controller';
58+
import { isMacOs13OrNewer } from './platform-version';
5859
import * as problemReport from './problem-report';
5960
import { resolveBin } from './proc';
6061
import ReconnectionBackoff from './reconnection-backoff';
@@ -765,6 +766,7 @@ class ApplicationMain
765766
forceShowChanges: CommandLineOptions.showChanges.match,
766767
navigationHistory: this.navigationHistory,
767768
currentApiAccessMethod: this.currentApiAccessMethod,
769+
isMacOs13OrNewer: isMacOs13OrNewer(),
768770
}));
769771

770772
IpcMainEventChannel.map.handleGetData(async () => ({

Diff for: gui/src/main/platform-version.ts

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ export function isMacOs11OrNewer() {
55
return process.platform === 'darwin' && major >= 20;
66
}
77

8+
export function isMacOs13OrNewer() {
9+
const [major] = parseVersion();
10+
return process.platform === 'darwin' && major >= 22;
11+
}
12+
813
// Windows 11 has the internal version 10.0.22000+.
914
export function isWindows11OrNewer() {
1015
const [major, minor, patch] = parseVersion();

Diff for: gui/src/renderer/app.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ export default class AppRenderer {
245245
this.storeAutoStart(initialState.autoStart);
246246
this.setChangelog(initialState.changelog, initialState.forceShowChanges);
247247
this.setCurrentApiAccessMethod(initialState.currentApiAccessMethod);
248+
this.reduxActions.userInterface.setIsMacOs13OrNewer(initialState.isMacOs13OrNewer);
248249

249250
if (initialState.macOsScrollbarVisibility !== undefined) {
250251
this.reduxActions.userInterface.setMacOsScrollbarVisibility(

Diff for: gui/src/renderer/components/Settings.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default function Support() {
2626

2727
const loginState = useSelector((state) => state.account.status);
2828
const connectedToDaemon = useSelector((state) => state.userInterface.connectedToDaemon);
29+
const isMacOs13OrNewer = useSelector((state) => state.userInterface.isMacOs13OrNewer);
2930

3031
const showSubSettings = loginState.type === 'ok' && connectedToDaemon;
3132

Diff for: gui/src/renderer/redux/userinterface/actions.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export interface ISetSelectLocationView {
5656
selectLocationView: LocationType;
5757
}
5858

59+
export interface ISetIsMacOs13OrNewer {
60+
type: 'SET_IS_MACOS13_OR_NEWER';
61+
isMacOs13OrNewer: boolean;
62+
}
63+
5964
export type UserInterfaceAction =
6065
| IUpdateLocaleAction
6166
| IUpdateWindowArrowPositionAction
@@ -67,7 +72,8 @@ export type UserInterfaceAction =
6772
| ISetChangelog
6873
| ISetForceShowChanges
6974
| ISetIsPerformingPostUpgrade
70-
| ISetSelectLocationView;
75+
| ISetSelectLocationView
76+
| ISetIsMacOs13OrNewer;
7177

7278
function updateLocale(locale: string): IUpdateLocaleAction {
7379
return {
@@ -147,6 +153,13 @@ function setSelectLocationView(selectLocationView: LocationType): ISetSelectLoca
147153
};
148154
}
149155

156+
function setIsMacOs13OrNewer(isMacOs13OrNewer: boolean): ISetIsMacOs13OrNewer {
157+
return {
158+
type: 'SET_IS_MACOS13_OR_NEWER',
159+
isMacOs13OrNewer,
160+
};
161+
}
162+
150163
export default {
151164
updateLocale,
152165
updateWindowArrowPosition,
@@ -159,4 +172,5 @@ export default {
159172
setForceShowChanges,
160173
setIsPerformingPostUpgrade,
161174
setSelectLocationView,
175+
setIsMacOs13OrNewer,
162176
};

Diff for: gui/src/renderer/redux/userinterface/reducers.ts

+8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export interface IUserInterfaceReduxState {
1515
forceShowChanges: boolean;
1616
isPerformingPostUpgrade: boolean;
1717
selectLocationView: LocationType;
18+
isMacOs13OrNewer: boolean;
1819
}
1920

2021
const initialState: IUserInterfaceReduxState = {
@@ -28,6 +29,7 @@ const initialState: IUserInterfaceReduxState = {
2829
forceShowChanges: false,
2930
isPerformingPostUpgrade: false,
3031
selectLocationView: LocationType.exit,
32+
isMacOs13OrNewer: true,
3133
};
3234

3335
export default function (
@@ -80,6 +82,12 @@ export default function (
8082
selectLocationView: action.selectLocationView,
8183
};
8284

85+
case 'SET_IS_MACOS13_OR_NEWER':
86+
return {
87+
...state,
88+
isMacOs13OrNewer: action.isMacOs13OrNewer,
89+
};
90+
8391
default:
8492
return state;
8593
}

Diff for: gui/src/shared/ipc-schema.ts

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export interface IAppStateSnapshot {
7777
forceShowChanges: boolean;
7878
navigationHistory?: IHistoryObject;
7979
currentApiAccessMethod?: AccessMethodSetting;
80+
isMacOs13OrNewer: boolean;
8081
}
8182

8283
// The different types of requests are:

Diff for: gui/test/e2e/setup/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class ApplicationMain {
174174
forceShowChanges: false,
175175
navigationHistory: undefined,
176176
scrollPositions: {},
177+
isMacOs13OrNewer: true,
177178
}));
178179

179180
IpcMainEventChannel.guiSettings.handleSetPreferredLocale((locale) => {

0 commit comments

Comments
 (0)