diff --git a/code/websites/pokedex.online/src/components/gamemaster/ActionToolbar.vue b/code/websites/pokedex.online/src/components/gamemaster/ActionToolbar.vue index d8a4d78..ff59ba5 100644 --- a/code/websites/pokedex.online/src/components/gamemaster/ActionToolbar.vue +++ b/code/websites/pokedex.online/src/components/gamemaster/ActionToolbar.vue @@ -36,6 +36,10 @@ const props = defineProps({ selectedFile: { type: String, default: '' + }, + selectionState: { + type: Object, + default: null } }); @@ -43,6 +47,13 @@ const displayLines = toRef(props, 'displayLines'); const fileContent = toRef(props, 'fileContent'); const selectedFile = toRef(props, 'selectedFile'); +const internalSelectionState = useLineSelection( + displayLines, + fileContent, + selectedFile +); +const activeSelectionState = props.selectionState || internalSelectionState; + const { selectionCount, copySelected, @@ -50,7 +61,7 @@ const { exportSelected, exportAll, shareUrl -} = useLineSelection(displayLines, fileContent, selectedFile); +} = activeSelectionState;