This repository has been archived by the owner on Jan 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
nikosszzz
commented
Jan 7, 2023
- RN will explode
* RN will explode
* also theme AMOLED only if theme has a 3rd value
rushiiMachine
suggested changes
Jan 7, 2023
@@ -44,9 +44,9 @@ export function themerInit(constants: typeof Constants) { | |||
|
|||
const themeFile = JSON.parse(AliuFS.readFile(THEMES_DIRECTORY + file.name, "text") as string) as Theme; | |||
|
|||
if (!themeFile?.name || !themeFile?.theme_color_map || !themeFile?.colors) throw new Error(`Theme file ${file.name} does not contain a name, theme_color_map or colors key.`); | |||
if (!themeFile?.name || !themeFile?.theme_color_map) throw new Error(`Theme file ${file.name} does not contain a name, theme_color_map or colors key.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
if (!themeFile?.name || !themeFile?.theme_color_map) throw new Error(`Theme file ${file.name} does not contain a name, theme_color_map or colors key.`); | |
if (!themeFile?.name || !(themeFile.theme_color_map || themeFile.color || themeFile.colour)) | |
throw new Error(`Theme ${file.name} does not contain a name and neither a theme_color_map, color or colours key.`); |
@@ -31,7 +31,7 @@ export function setTheme(theme: Theme) { | |||
// WARNING: this function is called before the Aliucord loads, meaning we're having limited access. | |||
export function themerInit(constants: typeof Constants) { | |||
try { | |||
if (!AliuFS.exists(SETTINGS_DIRECTORY + "Aliucord.json")) return; | |||
if (!AliuFS.exists(SETTINGS_DIRECTORY + "Aliucord.json")) throw new Error("Settings file does not exist."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nop just return and set themeApplied = false; or whatever
@@ -56,7 +56,7 @@ export function themerInit(constants: typeof Constants) { | |||
applyTheme(); | |||
} | |||
} catch (e) { | |||
themeApplied = false; | |||
themerErrored = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what
if (currentTheme.theme_color_map[key]) { | ||
discordConstants.ThemeColorMap[key][ThemeType.AMOLED] = currentTheme.theme_color_map[key]?.[ThemeType.DARK]; | ||
if (currentTheme.theme_color_map[key]?.[ThemeType.AMOLED]) discordConstants.ThemeColorMap[key][ThemeType.AMOLED] = currentTheme.theme_color_map[key]?.[ThemeType.AMOLED]; | ||
discordConstants.ThemeColorMap[key][ThemeType.LIGHT] = currentTheme.theme_color_map[key]?.[ThemeType.LIGHT]; | ||
discordConstants.ThemeColorMap[key][ThemeType.DARK] = currentTheme.theme_color_map[key]?.[ThemeType.DARK]; | ||
} | ||
} | ||
|
||
// Enmity compat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should only do enmity compat if theme_color_map does not exist (aliu takes priority)
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.