-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow developer to edit the database directly
closes #90
- Loading branch information
1 parent
f8c65bf
commit edc96b7
Showing
31 changed files
with
616 additions
and
518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,7 @@ | ||
.App { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
height: 40vmin; | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
.Main { | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
align-items: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { toastr } from 'react-redux-toastr'; | ||
import { createFlag } from './common'; | ||
import { | ||
FLAG_GETTING_DATABASE, | ||
GET_DATABASE_SUCCEEDED, | ||
FLAG_SETTING_DATABASE, | ||
SET_DATABASE_SUCCEEDED, | ||
} from '../types'; | ||
import { GET_DATABASE_CHANNEL, SET_DATABASE_CHANNEL } from '../config/channels'; | ||
import { ERROR_GENERAL } from '../config/errors'; | ||
import { | ||
ERROR_GETTING_DATABASE, | ||
ERROR_MESSAGE_HEADER, | ||
ERROR_SETTING_DATABASE, | ||
} from '../config/messages'; | ||
|
||
const flagGettingDatabase = createFlag(FLAG_GETTING_DATABASE); | ||
const flagSettingDatabase = createFlag(FLAG_SETTING_DATABASE); | ||
|
||
const getDatabase = async () => dispatch => { | ||
try { | ||
dispatch(flagGettingDatabase(true)); | ||
window.ipcRenderer.send(GET_DATABASE_CHANNEL); | ||
window.ipcRenderer.once(GET_DATABASE_CHANNEL, (event, db) => { | ||
if (db === ERROR_GENERAL) { | ||
toastr.error(ERROR_MESSAGE_HEADER, ERROR_GETTING_DATABASE); | ||
} else { | ||
dispatch({ | ||
type: GET_DATABASE_SUCCEEDED, | ||
payload: db, | ||
}); | ||
} | ||
dispatch(flagGettingDatabase(false)); | ||
}); | ||
} catch (err) { | ||
console.error(err); | ||
toastr.error(ERROR_MESSAGE_HEADER, ERROR_GETTING_DATABASE); | ||
} | ||
}; | ||
|
||
const setDatabase = async database => dispatch => { | ||
try { | ||
dispatch(flagSettingDatabase(true)); | ||
window.ipcRenderer.send(SET_DATABASE_CHANNEL, database); | ||
window.ipcRenderer.once(SET_DATABASE_CHANNEL, (event, db) => { | ||
if (db === ERROR_GENERAL) { | ||
toastr.error(ERROR_MESSAGE_HEADER, ERROR_GETTING_DATABASE); | ||
} else { | ||
dispatch({ | ||
type: SET_DATABASE_SUCCEEDED, | ||
payload: db, | ||
}); | ||
} | ||
dispatch(flagSettingDatabase(false)); | ||
}); | ||
} catch (err) { | ||
console.error(err); | ||
toastr.error(ERROR_MESSAGE_HEADER, ERROR_SETTING_DATABASE); | ||
} | ||
}; | ||
|
||
export { getDatabase, setDatabase }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
.Main { | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.LoadSpace { | ||
height: 100%; | ||
} | ||
height: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.