Compare commits

...

2 commits

Author SHA1 Message Date
Oj
925b41459b
[ElCompat] Use Webpack module for clipboard copy 2021-07-20 22:32:32 +02:00
Oj
7762d0bd07
[*Theme] ColorPalette: Add no val abort 2021-07-20 21:37:13 +02:00
2 changed files with 17 additions and 3 deletions

View file

@ -1,7 +1,9 @@
const { copy } = goosemod.webpackModules.findByProps('SUPPORTS_COPY', 'copy'); // Use Webpack module for Web support (instead of DiscordNative)
export const writeText = (text) => { // Write text to clipboard
return DiscordNative.clipboard.copy(text);
return copy(text);
};
export const readText = () => { // Read text from clipboard
return DiscordNative.clipboard.read();
return DiscordNative.clipboard.read(); // Web doesn't support clipboard reading (no Webpack for it like copy) - use DiscordNative
};

View file

@ -115,8 +115,20 @@ export default async (manifest, _content, repo) => {
break;
}
let abortNoVal = false;
while (v[1].startsWith('var(')) {
v[1] = variables.find((y) => y[0] === v[1].slice(4, -1))[1];
v[1] = variables.find((y) => y[0] === v[1].slice(4, -1))?.[1];
if (!v[1]) {
abortNoVal = true;
break;
}
}
if (abortNoVal) {
console.log('aborting color palette image, could not find var substitute', wanted);
break;
}
imagePalette.push([v[0], v[1]]);