describo / crate-builder-component

A VueJS UI component to build an RO-Crate
MIT License
6 stars 3 forks source link

Setting/changing Profile on a readonly crate fails #76

Closed beepsoft closed 9 months ago

beepsoft commented 9 months ago

In the dev app I first tried loading a crate, setting a Profile, and then turning readonly on and off. It works.

However, if I load a crate, set it to read-only and then set the Profile it fails with this and the Profile tabs are not displayed:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
    at applyTabDataIndicators (Shell.component.vue:441:1)
    at init (Shell.component.vue:374:1)
    at Shell.component.vue:323:1
    at callWithErrorHandling (runtime-core.esm-bundler.js:158:18)
    at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:166:17)
    at job (runtime-core.esm-bundler.js:1756:9)
    at flushPreFlushCbs (runtime-core.esm-bundler.js:304:7)
    at updateComponentPreRender (runtime-core.esm-bundler.js:5832:5)
    at ReactiveEffect.componentUpdateFn [as fn] (runtime-core.esm-bundler.js:5750:11)
    at ReactiveEffect.run (reactivity.esm-bundler.js:178:19)

This is the offending line: https://github.com/describo/crate-builder-component/blob/b7ac1f813c102318c76adfca2b0104577baaa117/src/crate-builder/RenderEntity/Shell.component.vue#L441

Here's a screen grab of this happening:

screencast-localhost_9000-2023.09.18-12_07_54.webm