初始化奇妙小屏幕控制器项目
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
export function createTemplateEditContext(template, baseline) {
|
||||
return {
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
revision: template.revision,
|
||||
readOnly: Boolean(template.read_only ?? template.readOnly),
|
||||
baseline,
|
||||
};
|
||||
}
|
||||
|
||||
export function templateEditSnapshot(context, serializedScene) {
|
||||
if (!context) return null;
|
||||
return {
|
||||
id: context.id,
|
||||
name: context.name,
|
||||
revision: context.revision,
|
||||
readOnly: Boolean(context.readOnly),
|
||||
dirty: serializedScene !== context.baseline,
|
||||
};
|
||||
}
|
||||
|
||||
export function sceneNeedsTemplateSave(context, serializedScene) {
|
||||
return !context || serializedScene !== context.baseline;
|
||||
}
|
||||
Reference in New Issue
Block a user