Fixing up the shared content for the native client

master
WolverinDEV 2021-03-20 16:39:50 +01:00
parent 79e67920a7
commit 9fa6633a1d
9 changed files with 34 additions and 6 deletions

View File

@ -1,4 +1,4 @@
export = api => {
export default api => {
api.cache(false);
const presets = [
[

View File

@ -83,6 +83,8 @@ export class GenericModalController<T extends keyof ModalConstructorArguments> i
});
events.on("action_close", () => this.destroy());
events.on("action_minimize", () => this.instance.minimize());
events.on("action_popout", () => {
if(!this.popedOut) {
if(!this.getModalClass().popoutSupported) {

View File

@ -88,6 +88,9 @@ export interface ModalInstanceController {
show() : Promise<void>;
hide() : Promise<void>;
minimize() : Promise<void>;
maximize() : Promise<void>;
destroy();
}

View File

@ -172,6 +172,26 @@ export class ExternalModalController implements ModalInstanceController {
});
}
async minimize(): Promise<void> {
await this.mutateWindow(async () => {
if (typeof this.windowId !== "string") {
return;
}
await getWindowManager().executeAction(this.windowId, "minimize");
});
}
async maximize(): Promise<void> {
await this.mutateWindow(async () => {
if (typeof this.windowId !== "string") {
return;
}
await getWindowManager().executeAction(this.windowId, "maximize");
});
}
private async mutateWindow<T>(callback: () => Promise<T>) : Promise<T> {
while(this.windowMutatePromise) {
await this.windowMutatePromise;

View File

@ -145,6 +145,9 @@ export class InternalModalInstance implements ModalInstanceController {
this.events.fire("notify_close");
}
async minimize(): Promise<void> { }
async maximize(): Promise<void> { }
destroy() {
this.destructModal();
this.events.destroy();

View File

@ -479,9 +479,9 @@ const TitleRenderer = (props: { events: Registry<VideoViewerEvents> }) => {
});
if(followId && followingName) {
return <React.Fragment key={"following"}><Translatable enforceTextOnly={true}>W2G - Following</Translatable> {followingName}</React.Fragment>;
return <React.Fragment key={"following"}><Translatable>W2G - Following</Translatable> {followingName}</React.Fragment>;
} else {
return <Translatable key={"watcher"} enforceTextOnly={true}>W2G - Watcher</Translatable>;
return <Translatable key={"watcher"}>W2G - Watcher</Translatable>;
}
};

View File

@ -3,7 +3,7 @@ import * as config_base from "./webpack.config";
export = env => config_base.config(env, "client").then(config => {
Object.assign(config.entry, {
"shared-app": ["./client/app/entry-points/AppMain.ts"],
"main-app": ["./client/app/entry-points/AppMain.ts"],
"modal-external": ["./client/app/entry-points/ModalWindow.ts"]
});

View File

@ -3,7 +3,7 @@ import * as config_base from "./webpack.config";
export = env => config_base.config(env, "web").then(config => {
Object.assign(config.entry, {
"shared-app": ["./web/app/entry-points/AppMain.ts"],
"main-app": ["./web/app/entry-points/AppMain.ts"],
"modal-external": ["./web/app/entry-points/ModalWindow.ts"]
});

View File

@ -76,7 +76,7 @@ const generateDefinitions = async (target: string) => {
mode: JSON.stringify(isDevelopment ? "debug" : "release"),
version: JSON.stringify(localBuildInfo.gitVersion),
timestamp: localBuildInfo.gitTimestamp,
entry_chunk_name: JSON.stringify(target === "web" ? "shared-app" : "client-app")
entry_chunk_name: JSON.stringify("main-app")
} as BuildDefinitions
} as any;
};