Skip to content

Commit 7575547

Browse files
committed
Remove Rust 2024 default notification
1 parent 27e40d8 commit 7575547

File tree

4 files changed

+3
-34
lines changed

4 files changed

+3
-34
lines changed

ui/frontend/Notifications.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Portal } from 'react-portal';
33

44
import { Close } from './Icon';
55
import { useAppDispatch, useAppSelector } from './hooks';
6-
import { seenRust2024IsDefault, seenRustSurvey2025 } from './reducers/notifications';
6+
import { seenRustSurvey2025 } from './reducers/notifications';
77
import { allowLongRun, wsExecuteKillCurrent } from './reducers/output/execute';
88
import * as selectors from './selectors';
99

@@ -17,29 +17,13 @@ const Notifications: React.FC = () => {
1717
return (
1818
<Portal>
1919
<div className={styles.container}>
20-
<Rust2024IsDefaultNotification />
2120
<RustSurvey2025Notification />
2221
<ExcessiveExecutionNotification />
2322
</div>
2423
</Portal>
2524
);
2625
};
2726

28-
const Rust2024IsDefaultNotification: React.FC = () => {
29-
const showIt = useAppSelector(selectors.showRust2024IsDefaultSelector);
30-
31-
const dispatch = useAppDispatch();
32-
const seenIt = useCallback(() => dispatch(seenRust2024IsDefault()), [dispatch]);
33-
34-
return showIt ? (
35-
<Notification onClose={seenIt}>
36-
As of Rust 1.85, the default edition of Rust is now Rust 2024. Learn more about editions in
37-
the <a href={EDITION_URL}>Edition Guide</a>. To specify which edition to use, use the advanced
38-
compilation options menu.
39-
</Notification>
40-
) : null;
41-
};
42-
4327
const RustSurvey2025Notification: React.FC = () => {
4428
const showIt = useAppSelector(selectors.showRustSurvey2025Selector);
4529

ui/frontend/reducers/notifications.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface State {
1313
seenRustSurvey2023: boolean; // expired
1414
seenDarkMode: boolean; // expired
1515
seenRustSurvey2024: boolean; // expired
16-
seenRust2024IsDefault: boolean;
16+
seenRust2024IsDefault: boolean; // expired
1717
seenRustSurvey2025: boolean;
1818
}
1919

@@ -28,7 +28,7 @@ const initialState: State = {
2828
seenRustSurvey2023: true,
2929
seenDarkMode: true,
3030
seenRustSurvey2024: true,
31-
seenRust2024IsDefault: false,
31+
seenRust2024IsDefault: true,
3232
seenRustSurvey2025: false,
3333
};
3434

@@ -38,10 +38,6 @@ const slice = createSlice({
3838
reducers: {
3939
notificationSeen: (state, action: PayloadAction<Notification>) => {
4040
switch (action.payload) {
41-
case Notification.Rust2024IsDefault: {
42-
state.seenRust2024IsDefault = true;
43-
break;
44-
}
4541
case Notification.RustSurvey2025: {
4642
state.seenRustSurvey2025 = true;
4743
break;
@@ -53,8 +49,6 @@ const slice = createSlice({
5349

5450
const { notificationSeen } = slice.actions;
5551

56-
export const seenRust2024IsDefault = () => notificationSeen(Notification.Rust2024IsDefault);
57-
5852
export const seenRustSurvey2025 = () => notificationSeen(Notification.RustSurvey2025);
5953

6054
export default slice.reducer;

ui/frontend/selectors/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,6 @@ const notificationsSelector = (state: State) => state.notifications;
367367

368368
const NOW = new Date();
369369

370-
const RUST_2024_IS_DEFAULT_END = new Date('2025-04-03T00:00:00Z');
371-
const RUST_2024_IS_DEFAULT_OPEN = NOW <= RUST_2024_IS_DEFAULT_END;
372-
export const showRust2024IsDefaultSelector = createSelector(
373-
notificationsSelector,
374-
notifications => RUST_2024_IS_DEFAULT_OPEN && !notifications.seenRust2024IsDefault,
375-
);
376-
377370
const RUST_SURVEY_2025_END = new Date('2025-12-17T00:00:00Z');
378371
const RUST_SURVEY_2025_OPEN = NOW <= RUST_SURVEY_2025_END;
379372
export const showRustSurvey2025Selector = createSelector(
@@ -382,7 +375,6 @@ export const showRustSurvey2025Selector = createSelector(
382375
);
383376

384377
export const anyNotificationsToShowSelector = createSelector(
385-
showRust2024IsDefaultSelector,
386378
showRustSurvey2025Selector,
387379
excessiveExecutionSelector,
388380
(...allNotifications) => allNotifications.some(n => n),

ui/frontend/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,5 @@ export enum Focus {
170170
}
171171

172172
export enum Notification {
173-
Rust2024IsDefault = 'rust-2024-is-default',
174173
RustSurvey2025 = 'rust-survey-2025',
175174
}

0 commit comments

Comments
 (0)