mirror of
https://github.com/chinchang/web-maker.git
synced 2025-02-19 20:55:55 +01:00
app: add ability to override settings for autoPreview
This commit is contained in:
parent
51a16d9346
commit
f7d7b8891f
@ -194,8 +194,14 @@ export default class ContentWrap extends Component {
|
||||
* @param {boolean} isManual Is this a manual preview request from user?
|
||||
*/
|
||||
setPreviewContent(isForced, isManual) {
|
||||
if (!this.props.prefs.autoPreview && !isManual) {
|
||||
return;
|
||||
if (!isManual) {
|
||||
let autoPreview =
|
||||
window.forcedSettings.autoPreview !== undefined
|
||||
? window.forcedSettings.autoPreview
|
||||
: this.props.prefs.autoPreview;
|
||||
if (!autoPreview) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.props.prefs.preserveConsoleLogs) {
|
||||
|
@ -293,8 +293,14 @@ export default class ContentWrapFiles extends Component {
|
||||
* @param {boolean} isManual Is this a manual preview request from user?
|
||||
*/
|
||||
setPreviewContent(isForced, isManual) {
|
||||
if (!this.props.prefs.autoPreview && !isManual) {
|
||||
return;
|
||||
if (!isManual) {
|
||||
let autoPreview =
|
||||
window.forcedSettings.autoPreview !== undefined
|
||||
? window.forcedSettings.autoPreview
|
||||
: this.props.prefs.autoPreview;
|
||||
if (!autoPreview) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.props.prefs.preserveConsoleLogs) {
|
||||
|
@ -963,7 +963,11 @@ export default class App extends Component {
|
||||
|
||||
const prefs = this.state.prefs;
|
||||
// Show/hide RUN button based on autoPreview setting.
|
||||
runBtn.classList[prefs.autoPreview ? 'add' : 'remove']('hide');
|
||||
let autoPreview =
|
||||
window.forcedSettings.autoPreview !== undefined
|
||||
? window.forcedSettings
|
||||
: prefs.autoPreview;
|
||||
runBtn.classList[autoPreview ? 'add' : 'remove']('hide');
|
||||
|
||||
this.contentWrap.applyCodemirrorSettings(this.state.prefs);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user