forked from trent_larson/crowd-funder-for-time-pwa
fix: linting issues
This commit is contained in:
@@ -182,7 +182,7 @@
|
||||
],
|
||||
"extraResources": [
|
||||
{
|
||||
"from": "dist",
|
||||
"from": "dist-electron/www",
|
||||
"to": "www"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -25,6 +25,25 @@ function createWindow(): void {
|
||||
logger.log("Checking preload path:", preloadPath);
|
||||
logger.log("Preload exists:", fs.existsSync(preloadPath));
|
||||
|
||||
// Log environment and paths
|
||||
logger.log("process.cwd():", process.cwd());
|
||||
logger.log("__dirname:", __dirname);
|
||||
logger.log("app.getAppPath():", app.getAppPath());
|
||||
logger.log("app.isPackaged:", app.isPackaged);
|
||||
|
||||
// List files in __dirname and __dirname/www
|
||||
try {
|
||||
logger.log("Files in __dirname:", fs.readdirSync(__dirname));
|
||||
const wwwDir = path.join(__dirname, "www");
|
||||
if (fs.existsSync(wwwDir)) {
|
||||
logger.log("Files in www:", fs.readdirSync(wwwDir));
|
||||
} else {
|
||||
logger.log("www directory does not exist in __dirname");
|
||||
}
|
||||
} catch (e) {
|
||||
logger.error("Error reading directories:", e);
|
||||
}
|
||||
|
||||
// Create the browser window.
|
||||
const mainWindow = new BrowserWindow({
|
||||
width: 1200,
|
||||
@@ -88,7 +107,16 @@ function createWindow(): void {
|
||||
logger.log("process.cwd():", process.cwd());
|
||||
}
|
||||
|
||||
const indexPath = path.join(__dirname, "www", "index.html");
|
||||
let indexPath = path.resolve(__dirname, "dist-electron", "www", "index.html");
|
||||
if (!fs.existsSync(indexPath)) {
|
||||
// Fallback for dev mode
|
||||
indexPath = path.resolve(
|
||||
process.cwd(),
|
||||
"dist-electron",
|
||||
"www",
|
||||
"index.html",
|
||||
);
|
||||
}
|
||||
|
||||
if (isDev) {
|
||||
logger.log("Loading index from:", indexPath);
|
||||
|
||||
@@ -123,6 +123,7 @@ class AbsurdSqlDatabaseService implements DatabaseService {
|
||||
if (!operation) continue;
|
||||
|
||||
try {
|
||||
let queryResult: QueryExecResult[] = [];
|
||||
let result: unknown;
|
||||
switch (operation.type) {
|
||||
case "run":
|
||||
@@ -132,11 +133,11 @@ class AbsurdSqlDatabaseService implements DatabaseService {
|
||||
result = await this.db.exec(operation.sql, operation.params);
|
||||
break;
|
||||
case "getOneRow":
|
||||
const queryResult = await this.db.exec(operation.sql, operation.params);
|
||||
queryResult = await this.db.exec(operation.sql, operation.params);
|
||||
result = queryResult[0]?.values[0];
|
||||
break;
|
||||
case "getAll":
|
||||
const allResult = await this.db.exec(operation.sql, operation.params);
|
||||
queryResult = await this.db.exec(operation.sql, operation.params);
|
||||
result = allResult[0]?.values || [];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,12 @@ export class WebPlatformService implements PlatformService {
|
||||
return databaseService.run(sql, params);
|
||||
}
|
||||
|
||||
async dbGetOneRow(sql: string, params?: unknown[]): Promise<unknown[] | undefined> {
|
||||
return databaseService.query(sql, params).then((result: QueryExecResult[]) => result[0]?.values[0]);
|
||||
async dbGetOneRow(
|
||||
sql: string,
|
||||
params?: unknown[],
|
||||
): Promise<unknown[] | undefined> {
|
||||
return databaseService
|
||||
.query(sql, params)
|
||||
.then((result: QueryExecResult[]) => result[0]?.values[0]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user