chore: remove legacy Redux migration

This commit is contained in:
Paul Makles
2022-06-18 14:49:59 +01:00
parent eff997e251
commit 2a59161929
4 changed files with 3 additions and 239 deletions

View File

@@ -1,16 +1,8 @@
import { action, computed, makeAutoObservable, ObservableMap } from "mobx";
import { Channel } from "revolt.js";
import { Message } from "revolt.js";
import { Server } from "revolt.js";
import { Channel, Message, Server } from "revolt.js";
import { mapToRecord } from "../../lib/conversion";
import {
legacyMigrateNotification,
LegacyNotifications,
} from "../legacy/redux";
import { MIGRATIONS } from "../State";
import Persistent from "../interfaces/Persistent";
import Store from "../interfaces/Store";
import Syncable from "../interfaces/Syncable";
@@ -217,11 +209,7 @@ export default class NotificationOptions
return false;
}
@action apply(_key: "notifications", data: unknown, revision: number) {
if (revision < MIGRATIONS.REDUX) {
data = legacyMigrateNotification(data as LegacyNotifications);
}
@action apply(_key: "notifications", data: unknown, _revision: number) {
this.hydrate(data as Data);
}

View File

@@ -2,18 +2,9 @@ import { action, computed, makeAutoObservable, ObservableMap } from "mobx";
import { mapToRecord } from "../../lib/conversion";
import {
LegacyAppearanceOptions,
legacyMigrateAppearance,
legacyMigrateTheme,
LegacyTheme,
LegacyThemeOptions,
} from "../legacy/redux";
import { Fonts, MonospaceFonts, Overrides } from "../../context/Theme";
import { EmojiPack } from "../../components/common/Emoji";
import { MIGRATIONS } from "../State";
import Persistent from "../interfaces/Persistent";
import Store from "../interfaces/Store";
@@ -129,16 +120,8 @@ export default class Settings
@action apply(
key: "appearance" | "theme",
data: unknown,
revision: number,
_revision: number,
) {
if (revision < MIGRATIONS.REDUX) {
if (key === "appearance") {
data = legacyMigrateAppearance(data as LegacyAppearanceOptions);
} else {
data = legacyMigrateTheme(data as LegacyThemeOptions);
}
}
if (key === "appearance") {
this.remove("appearance:emoji");
this.remove("appearance:seasonal");