Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
feat(toggleAutorotate): added toggleAutorotate reducer
Browse files Browse the repository at this point in the history
* also added export of initialState
  • Loading branch information
kaosat-dev committed Jan 6, 2018
1 parent 7673164 commit ca626b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 53 deletions.
46 changes: 0 additions & 46 deletions src/settings.js

This file was deleted.

13 changes: 6 additions & 7 deletions src/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ const {mergeArray} = require('most')
const packageMetadata = require('../package.json')
const {merge, toArray} = require('./utils')
const {getScriptFile, loadScript} = require('./core/scripLoading')
/*
let settings = require('./settings')
let themeName = store.get('ui.theme.name', settings.theme)
let designName = store.get('lastDesign.name', undefined)
let designPath = store.get('lastDesign.path', undefined) */

// very nice color for the cuts [0, 0.6, 1] to go with the orange
const themes = {
Expand Down Expand Up @@ -72,6 +67,11 @@ function makeState (actions) {
toggleAutoReload: (state, autoReload) => {
return Object.assign({}, state, {autoReload})
},
toggleAutorotate: (state, autoRotate) => {
const controls = Object.assign({}, state.viewer.controls, {autoRotate: {enabled: autoRotate}})
const viewer = Object.assign({}, state.viewer, {controls})
return Object.assign({}, state, {viewer})
},
changeExportFormat: (state, exportFormat) => {
console.log('changeExportFormat')
return Object.assign({}, state, {exportFormat})
Expand Down Expand Up @@ -125,7 +125,6 @@ function makeState (actions) {
const availableExportFormats = supportedFormatsForObjects(solids)
.filter(formatName => !formatsToIgnore.includes(formatName))
.map(function (formatName) {
console.log('formatName')
return {name: formatName, displayName: formats[formatName].displayName}
})
let exportFormat = availableExportFormats[0].name
Expand Down Expand Up @@ -169,4 +168,4 @@ function makeState (actions) {
return state$
}

module.exports = makeState
module.exports = {makeState, initialState}

0 comments on commit ca626b2

Please sign in to comment.