Skip to content

Commit

Permalink
Merge pull request #885 from 3DStreet/fix-save-as-notif
Browse files Browse the repository at this point in the history
cleanup plus reduce notification duration
  • Loading branch information
kfarr authored Oct 2, 2024
2 parents 5f58559 + cdeb538 commit 78b8590
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/notify.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var { Notyf } = require('../lib/notyf.min.js');

AFRAME.registerComponent('notify', {
schema: {
duration: { type: 'number', default: 6000 },
duration: { type: 'number', default: 3000 },
ripple: { type: 'boolean', default: false },
position: {
type: 'string',
Expand Down
14 changes: 4 additions & 10 deletions src/editor/components/scenegraph/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,17 +278,11 @@ export default class Toolbar extends Component {
// Change the hash URL without reloading
window.location.hash = `#/scenes/${currentSceneId}.json`;
if (this.state.savedNewDocument) {
STREET.notify.successMessage(
'Scene saved to 3DStreet Cloud as a new file.'
);
this.setState({ savedNewDocument: false }); // go back to default assumption of save overwrite
} else {
const notification = STREET.notify.successMessage(
'Scene saved to 3DStreet Cloud in existing file.'
);
this.setState({ notification });
console.log('message', notification);
}
const notification = STREET.notify.successMessage('Scene saved');
this.setState({ notification });

this.setState({ isAuthor: true });
sendMetric('SaveSceneAction', doSaveAs ? 'saveAs' : 'save');
} catch (error) {
Expand Down Expand Up @@ -317,7 +311,7 @@ export default class Toolbar extends Component {
}
this.cloudSaveHandler({ doSaveAs: false });
}
}, 500);
}, 1000);

handleRemixClick = () => {
posthog.capture('remix_scene_clicked');
Expand Down

0 comments on commit 78b8590

Please sign in to comment.