Skip to content

Commit

Permalink
fix store
Browse files Browse the repository at this point in the history
  • Loading branch information
beebls committed Aug 3, 2024
1 parent 92204e4 commit fe9377b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/backend-impl/decky-backend-repository-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class DeckyBackendRepository implements IBackendRepository {
}
async fetch<Return>(url: string, request: RequestInit) {
try {
console.log("CSSLODAER FETCH", url, request);
const res = await fetchNoCors(url, request);
if (!res.ok) {
throw new Error(`Res Not Okay - Code ${res.status}`);
Expand Down
21 changes: 9 additions & 12 deletions src/modules/theme-store/context/ThemeBrowserStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,19 @@ interface IThemeBrowserStore extends ThemeBrowserStoreValues, ThemeBrowserStoreA
const ThemeBrowserStoreContext = createContext<StoreApi<IThemeBrowserStore> | null>(null);

function generateParamStr(searchOpts: ThemeQueryRequest) {
const searchOptsClone = structuredClone(searchOpts);
let prependString = "BPM-CSS.-Preset";
switch (searchOpts.filters) {
// If it's desktop themes, remove the "BPM Only" filter in the default
case "Desktop":
prependString = "-Preset";
break;
// If it's presets, remove the preset exclusion in the default
case "Preset":
prependString = "BPM-CSS";
break;
if (searchOptsClone.filters.includes("Desktop")) {
prependString = "-Preset";
}
searchOpts.filters === "All" ? (searchOpts.filters = "") : (prependString += ".");
prependString && (searchOpts.filters = prependString + searchOpts.filters);
if (searchOptsClone.filters.includes("Preset")) {
prependString = "BPM-CSS";
}
searchOptsClone.filters === "All" ? (searchOptsClone.filters = "") : (prependString += ".");
prependString && (searchOptsClone.filters = prependString + searchOptsClone.filters);

// @ts-expect-error
const paramStr = new URLSearchParams(searchOpts).toString();
const paramStr = new URLSearchParams(searchOptsClone).toString();
return paramStr;
}

Expand Down

0 comments on commit fe9377b

Please sign in to comment.