Fixing up the shared content for the native client
parent
79e67920a7
commit
9fa6633a1d
|
@ -1,4 +1,4 @@
|
||||||
export = api => {
|
export default api => {
|
||||||
api.cache(false);
|
api.cache(false);
|
||||||
const presets = [
|
const presets = [
|
||||||
[
|
[
|
||||||
|
|
|
@ -83,6 +83,8 @@ export class GenericModalController<T extends keyof ModalConstructorArguments> i
|
||||||
});
|
});
|
||||||
|
|
||||||
events.on("action_close", () => this.destroy());
|
events.on("action_close", () => this.destroy());
|
||||||
|
events.on("action_minimize", () => this.instance.minimize());
|
||||||
|
|
||||||
events.on("action_popout", () => {
|
events.on("action_popout", () => {
|
||||||
if(!this.popedOut) {
|
if(!this.popedOut) {
|
||||||
if(!this.getModalClass().popoutSupported) {
|
if(!this.getModalClass().popoutSupported) {
|
||||||
|
|
|
@ -88,6 +88,9 @@ export interface ModalInstanceController {
|
||||||
show() : Promise<void>;
|
show() : Promise<void>;
|
||||||
hide() : Promise<void>;
|
hide() : Promise<void>;
|
||||||
|
|
||||||
|
minimize() : Promise<void>;
|
||||||
|
maximize() : Promise<void>;
|
||||||
|
|
||||||
destroy();
|
destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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> {
|
private async mutateWindow<T>(callback: () => Promise<T>) : Promise<T> {
|
||||||
while(this.windowMutatePromise) {
|
while(this.windowMutatePromise) {
|
||||||
await this.windowMutatePromise;
|
await this.windowMutatePromise;
|
||||||
|
|
|
@ -145,6 +145,9 @@ export class InternalModalInstance implements ModalInstanceController {
|
||||||
this.events.fire("notify_close");
|
this.events.fire("notify_close");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async minimize(): Promise<void> { }
|
||||||
|
async maximize(): Promise<void> { }
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
this.destructModal();
|
this.destructModal();
|
||||||
this.events.destroy();
|
this.events.destroy();
|
||||||
|
|
|
@ -479,9 +479,9 @@ const TitleRenderer = (props: { events: Registry<VideoViewerEvents> }) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
if(followId && followingName) {
|
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 {
|
} else {
|
||||||
return <Translatable key={"watcher"} enforceTextOnly={true}>W2G - Watcher</Translatable>;
|
return <Translatable key={"watcher"}>W2G - Watcher</Translatable>;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import * as config_base from "./webpack.config";
|
||||||
|
|
||||||
export = env => config_base.config(env, "client").then(config => {
|
export = env => config_base.config(env, "client").then(config => {
|
||||||
Object.assign(config.entry, {
|
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"]
|
"modal-external": ["./client/app/entry-points/ModalWindow.ts"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import * as config_base from "./webpack.config";
|
||||||
|
|
||||||
export = env => config_base.config(env, "web").then(config => {
|
export = env => config_base.config(env, "web").then(config => {
|
||||||
Object.assign(config.entry, {
|
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"]
|
"modal-external": ["./web/app/entry-points/ModalWindow.ts"]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ const generateDefinitions = async (target: string) => {
|
||||||
mode: JSON.stringify(isDevelopment ? "debug" : "release"),
|
mode: JSON.stringify(isDevelopment ? "debug" : "release"),
|
||||||
version: JSON.stringify(localBuildInfo.gitVersion),
|
version: JSON.stringify(localBuildInfo.gitVersion),
|
||||||
timestamp: localBuildInfo.gitTimestamp,
|
timestamp: localBuildInfo.gitTimestamp,
|
||||||
entry_chunk_name: JSON.stringify(target === "web" ? "shared-app" : "client-app")
|
entry_chunk_name: JSON.stringify("main-app")
|
||||||
} as BuildDefinitions
|
} as BuildDefinitions
|
||||||
} as any;
|
} as any;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue