Commit 508b7789 authored by nanahira's avatar nanahira

workaround fix of error

parent 858ac016
...@@ -5,4 +5,19 @@ import { AppsJson } from '../utility/apps-json-type'; ...@@ -5,4 +5,19 @@ import { AppsJson } from '../utility/apps-json-type';
export class AppBase extends TimeBase { export class AppBase extends TimeBase {
@Column('jsonb', { nullable: true }) @Column('jsonb', { nullable: true })
appData: AppsJson.App; appData: AppsJson.App;
get displayData() {
if (!this.appData) {
return null;
}
if (!this.appData.actions) {
this.appData.actions = {};
}
for (const field of Object.values(AppsJson.Platform)) {
if (!this.appData.actions[field]) {
this.appData.actions[field] = {};
}
}
return this.appData;
}
} }
...@@ -22,7 +22,7 @@ export class UpdateService extends ConsoleLogger { ...@@ -22,7 +22,7 @@ export class UpdateService extends ConsoleLogger {
} }
async getAppsJson() { async getAppsJson() {
return (await this.db.getRepository(App).find({ where: { appData: Not(IsNull()), isDeleted: false } })).map((a) => a.appData); return (await this.db.getRepository(App).find({ where: { appData: Not(IsNull()), isDeleted: false } })).map((a) => a.displayData);
} }
private async getBuild( private async getBuild(
......
...@@ -18,9 +18,9 @@ export namespace AppsJson { ...@@ -18,9 +18,9 @@ export namespace AppsJson {
Windows = 'win32', Windows = 'win32',
} }
export type LocaleWise<T> = Record<Locale, T>; export type LocaleWise<T> = Partial<Record<Locale, T>>;
export type PlatformWise<T> = Record<Platform, T>; export type PlatformWise<T> = Partial<Record<Platform, T>>;
export interface Developer { export interface Developer {
name: string; name: string;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment