mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-06-25 17:10:43 +00:00
Update room.core.vue
This commit is contained in:
parent
bcc965a19c
commit
8b5d006248
1 changed files with 24 additions and 2 deletions
|
|
@ -459,8 +459,30 @@ function impor() {
|
|||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
try {
|
||||
localStorage.setItem('roomData', reader.result as string);
|
||||
window.location.reload();
|
||||
let data = JSON.parse(reader.result as string);
|
||||
// 後方互換性のため
|
||||
if (data.attachments == null) {
|
||||
data = {
|
||||
def: data,
|
||||
attachments: { files: [] },
|
||||
};
|
||||
}
|
||||
if (data.def.worldScale == null) {
|
||||
data.def.worldScale = 1;
|
||||
}
|
||||
if (data.def.heya != null) {
|
||||
data.def.env = data.def.heya;
|
||||
delete data.def.heya;
|
||||
}
|
||||
os.apiWithDialog('world/rooms/update', {
|
||||
roomId: props.room.id,
|
||||
def: {
|
||||
...data.def,
|
||||
_v: roomSpecVersion,
|
||||
},
|
||||
}).then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
} catch (e) {
|
||||
alert('Failed to load room data: ' + e);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue