mirror of
https://github.com/upscayl/upscayl.git
synced 2026-04-25 03:00:05 -04:00
Fix macos builds
This commit is contained in:
@@ -1,11 +1,29 @@
|
||||
import fs from "fs";
|
||||
import logit from "./logit";
|
||||
import { MessageBoxOptions, dialog } from "electron";
|
||||
import { MessageBoxOptions, app, dialog } from "electron";
|
||||
import settings from "electron-settings";
|
||||
|
||||
const getModels = (folderPath: string | undefined) => {
|
||||
const getModels = async (folderPath: string | undefined) => {
|
||||
let models: string[] = [];
|
||||
let isValid = false;
|
||||
|
||||
// SECURITY SCOPED BOOKMARKS
|
||||
let closeAccess;
|
||||
const customModelsBookmarks = await settings.get("custom-models-bookmarks");
|
||||
if (customModelsBookmarks) {
|
||||
console.log(
|
||||
"🚀 => file: get-models.ts:18 => customModelsBookmarks:",
|
||||
customModelsBookmarks
|
||||
);
|
||||
try {
|
||||
closeAccess = app.startAccessingSecurityScopedResource(
|
||||
customModelsBookmarks as string
|
||||
);
|
||||
} catch (error) {
|
||||
logit("📁 Custom Models Bookmarks Error: ", error);
|
||||
}
|
||||
}
|
||||
|
||||
if (!folderPath) {
|
||||
logit("❌ Invalid Custom Model Folder Detected");
|
||||
const options: MessageBoxOptions = {
|
||||
|
||||
@@ -11,8 +11,8 @@ import { getMainWindow } from "../main-window";
|
||||
* // Set a value
|
||||
* settings.set("key", value);
|
||||
*/
|
||||
export const settings = {
|
||||
get: (key: string, parse: boolean = false): any => {
|
||||
export const localStorage = {
|
||||
get: <T>(key: string, parse: boolean = false): T | null => {
|
||||
const mainWindow = getMainWindow();
|
||||
if (!mainWindow) return null;
|
||||
let result = null;
|
||||
Reference in New Issue
Block a user