fix: allow to toggle between modes when view only mode to make UI consistent (#3009)

This commit is contained in:
Aakansha Doshi 2021-02-12 14:10:40 +05:30 committed by GitHub
parent ecbd5ba55d
commit b5fc8757a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View file

@ -8,6 +8,7 @@ import {
} from "./types";
import { ExcalidrawElement } from "../element/types";
import { AppState, ExcalidrawProps } from "../types";
import { MODES } from "../constants";
// This is the <App> component, but for now we don't care about anything but its
// `canvas` state.
@ -68,7 +69,7 @@ export class ActionManager implements ActionsManagerInterface {
}
const { viewModeEnabled } = this.getAppState();
if (viewModeEnabled) {
if (data[0].name !== "viewMode") {
if (!Object.values(MODES).includes(data[0].name)) {
return false;
}
}