Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit d6d5ebf

Browse files
Merge pull request #797 from deckgo/re-hydrate-editor
fix: re-hydrate editor with prerendering
2 parents dadf6c3 + 37687f3 commit d6d5ebf

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

studio/prerender.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {PrerenderHydrateOptions} from '@stencil/core/internal/stencil-public-com
44
export const config: PrerenderConfig = {
55
hydrateOptions(url?: URL): PrerenderHydrateOptions {
66
const hydrate: PrerenderHydrateOptions = {
7-
excludeComponents: ['deckgo-highlight-code', 'deckgo-slide-poll', 'deckgo-remote', 'app-editor'],
7+
excludeComponents: ['deckgo-highlight-code', 'deckgo-slide-poll', 'deckgo-remote'],
88
};
99
return hydrate;
1010
},

studio/src/app/handlers/editor/events/remote/remote-events.handler.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ export class RemoteEventsHandler {
4242
}
4343

4444
async destroy() {
45+
if (!this.el) {
46+
return;
47+
}
48+
4549
await this.disconnect();
4650

4751
if (this.destroyConnectListener) {

studio/src/app/pages/editor/app-editor/app-editor.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, Element, h, JSX, Listen, Prop, State} from '@stencil/core';
1+
import {Build, Component, Element, h, JSX, Listen, Prop, State} from '@stencil/core';
22

33
import {ItemReorderEventDetail, modalController, OverlayEventDetail} from '@ionic/core';
44

@@ -162,6 +162,10 @@ export class AppEditor {
162162
}
163163

164164
async initOffline() {
165+
if (Build.isServer) {
166+
return;
167+
}
168+
165169
// if we are offline we can't create a new deck or edit another one that the one we have marked as currently being edited offline
166170
const offline: OfflineDeck = await this.offlineService.status();
167171
if (offline !== undefined) {

0 commit comments

Comments
 (0)