mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
fix auto clearing matching themes
This commit is contained in:
@@ -76,14 +76,14 @@ export const ThemeCover: React.FC<ThemeCoverProps> = ({
|
|||||||
{ isEditMode || !downloaded &&
|
{ isEditMode || !downloaded &&
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className="absolute z-20 flex w-8 h-8 p-2 text-white transition-all rounded-full delay-[20ms] opacity-0 top-1 right-2 dark:bg-black/50 place-items-center group-hover:opacity-100 group-hover:top-[1.25rem]"
|
className="absolute z-20 flex w-8 h-8 p-2 text-white transition-all rounded-full delay-[20ms] opacity-0 top-1 right-2 bg-black/50 place-items-center group-hover:opacity-100 group-hover:top-[1.25rem]"
|
||||||
onClick={(event) => { event?.preventDefault(), browser.runtime.sendMessage({ type: 'currentTab', info: 'OpenThemeCreator', body: { themeID: theme.id } }) }}
|
onClick={(event) => { event?.preventDefault(), browser.runtime.sendMessage({ type: 'currentTab', info: 'OpenThemeCreator', body: { themeID: theme.id } }) }}
|
||||||
>
|
>
|
||||||
<PencilIcon className="w-4 h-4" />
|
<PencilIcon className="w-4 h-4" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="absolute z-20 flex w-8 h-8 p-2 text-white transition-all rounded-full opacity-0 top-1 right-12 dark:bg-black/50 place-items-center group-hover:opacity-100 group-hover:top-[1.25rem]"
|
className="absolute z-20 flex w-8 h-8 p-2 text-white transition-all rounded-full opacity-0 top-1 right-12 bg-black/50 place-items-center group-hover:opacity-100 group-hover:top-[1.25rem]"
|
||||||
onClick={handleShareClick}
|
onClick={handleShareClick}
|
||||||
>
|
>
|
||||||
{uploading ? <LoadingSpinner size={16} /> : <ArrowUpOnSquareIcon className="w-4 h-4" />}
|
{uploading ? <LoadingSpinner size={16} /> : <ArrowUpOnSquareIcon className="w-4 h-4" />}
|
||||||
@@ -101,7 +101,7 @@ export const ThemeCover: React.FC<ThemeCoverProps> = ({
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
theme.hideThemeName ? <></> :
|
theme.hideThemeName ? <></> :
|
||||||
<div className="z-10">{theme.name}</div>
|
<div className={`z-10 ${theme.coverImage && 'text-white'}`}>{theme.name}</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useEffect, useState, useCallback, forwardRef, useImperativeHandle, ForwardRefExoticComponent, RefAttributes } from 'react';
|
import React, { useEffect, useState, useCallback, forwardRef, useImperativeHandle, ForwardRefExoticComponent, RefAttributes } from 'react';
|
||||||
import { listThemes, deleteTheme, setTheme, disableTheme, getDownloadedThemes } from '../hooks/ThemeManagment';
|
import { listThemes, deleteTheme, setTheme, disableTheme, getDownloadedThemes, sendThemeUpdate } from '../hooks/ThemeManagment';
|
||||||
import { ThemeCover } from './ThemeCover';
|
import { ThemeCover } from './ThemeCover';
|
||||||
import browser from 'webextension-polyfill';
|
import browser from 'webextension-polyfill';
|
||||||
import { CustomTheme, DownloadedTheme } from '../types/CustomThemes';
|
import { CustomTheme, DownloadedTheme } from '../types/CustomThemes';
|
||||||
@@ -61,7 +61,10 @@ const ThemeSelector: ForwardRefExoticComponent<Omit<ThemeSelectorProps, "ref"> &
|
|||||||
setDownloadedThemes(await getDownloadedThemes());
|
setDownloadedThemes(await getDownloadedThemes());
|
||||||
setSelectedTheme(selectedTheme ? selectedTheme : '');
|
setSelectedTheme(selectedTheme ? selectedTheme : '');
|
||||||
|
|
||||||
const matchingThemes = themes.filter(theme => downloadedThemes.some((downloadedTheme: DownloadedTheme) => downloadedTheme.id === theme.id));
|
const matchingThemes = themes.filter(theme =>
|
||||||
|
downloadedThemes.some(downloadedTheme => downloadedTheme.id === theme.id)
|
||||||
|
);
|
||||||
|
|
||||||
if (matchingThemes.length > 0) {
|
if (matchingThemes.length > 0) {
|
||||||
matchingThemes.forEach((theme) => {
|
matchingThemes.forEach((theme) => {
|
||||||
browser.runtime.sendMessage({
|
browser.runtime.sendMessage({
|
||||||
|
|||||||
@@ -95,11 +95,6 @@ const Store = () => {
|
|||||||
setInstallingThemes(installingThemes.filter(theme => theme !== id));
|
setInstallingThemes(installingThemes.filter(theme => theme !== id));
|
||||||
setCurrentThemes(currentThemes.filter(theme => theme !== id));
|
setCurrentThemes(currentThemes.filter(theme => theme !== id));
|
||||||
});
|
});
|
||||||
|
|
||||||
/* browser.runtime.sendMessage({ type: 'StoreRemoveTheme', body: { themeContent } }).then(async () => {
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
||||||
setInstallingThemes(installingThemes.filter(theme => theme !== id));
|
|
||||||
}); */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user