Skip to content

Commit 6b142df

Browse files
committed
ugh
1 parent 6a8055c commit 6b142df

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

v3/js/opt-frontend.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,17 @@ function initTogetherJS() {
152152
hashchangeSignalFromRemote = true;
153153
try {
154154
console.log("TogetherJS RECEIVE hashchange", msg.appMode);
155-
if (appMode != msg.appMode) {
156-
appMode = msg.appMode; // assign this to the GLOBAL appMode
157-
updateAppDisplay();
155+
156+
// TODO: this will infinite loop if you hit the "back button"!
157+
if (msg.appMode != appMode) {
158+
// UGH: need to do this to keep the URL hashes consistent across
159+
// clients, or else the hashchange trigger won't fire
160+
if (msg.appMode == 'edit') {
161+
enterEditMode();
162+
}
163+
else if (msg.appMode == 'display') {
164+
enterDisplayMode();
165+
}
158166
}
159167
}
160168
finally {

0 commit comments

Comments
 (0)