Skip to content

Commit

Permalink
setting to start in editor mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aepyornis committed Dec 14, 2022
1 parent 3e1fa71 commit fdbcb9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/util/defaultState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export interface SettingsState {
logActions: boolean
bugReportUrl: string | null
helpUrl: string | null
startInEditMode: boolean
}

export interface StateWithoutHistory {
Expand Down Expand Up @@ -253,6 +254,7 @@ const defaultState: State = {
logActions: false,
bugReportUrl: "https://littlesis.org/bug_report",
helpUrl: "https://littlesis.org/help/oligrapher",
startInEditMode: false,
},

// for Undo/Redo
Expand Down
2 changes: 1 addition & 1 deletion app/util/stateInitializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function stateInitializer(legacyState: any): State {

state.graph = convertGraph(state.graph)

state.display.modes.editor = userCanEditSelector(state)
state.display.modes.editor = state.settings.startInEditMode && userCanEditSelector(state)
state.display.viewBox = calculateViewBoxFromGraph(state.graph)
state.display.modes.story = calculateStoryMode(state)

Expand Down
2 changes: 1 addition & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<script>
const oli = new Oligrapher({
settings: { logActions: true },
settings: { logActions: true, startInEditMode: true },
attributes: {
title: "Blank Map",
date: "January 12, 2018",
Expand Down

0 comments on commit fdbcb9f

Please sign in to comment.