Skip to main content

Type Alias: SaveFavouriteScene()

SaveFavouriteScene = () => Promise<boolean>

Function

Updates an existing saved modular scene with the current state.

This method saves the current modular scene layout and component configurations over an existing saved favorite. This is useful for updating a scene after making modifications without creating a new entry or changing its name.

The method will only work if the current scene was previously loaded from a favorite; attempting to update a scene that hasn't been saved yet will fail. For new scenes, use saveFavouriteSceneAs instead.

Returns

Promise<boolean>

A promise that resolves to true if the update was successful, false otherwise

Example

// Update the current scene when the user clicks the "Update" button
document.getElementById('update-scene-btn').addEventListener('click', async () => {
// Check if we have a loaded scene to update
const sceneShortcode = window.mimeeqApp.observers.modular.favSceneShortcode.getValue().newValue;

if (!sceneShortcode) {
showNotification('This is a new scene that hasn\'t been saved yet. Please use "Save As" instead.', 'warning');
return;
}

const success = await window.mimeeqApp.actions.saveFavouriteScene();

if (success) {
showNotification('Scene updated successfully');
} else {
showNotification('Failed to update scene', 'error');
}
});

Emits

mimeeq-modular-save-scene This event is fired when Favourite Scene was updated or created, including shortcode and scene name