fix: use Alpine.data() to register giteaWorkspace component
FlowDeck CI / test (push) Failing after 4s
FlowDeck CI / docker (push) Has been skipped

Replaced global function giteaWorkspace() with Alpine.data('giteaWorkspace', ...)
registered via document.addEventListener('alpine:init', ...). This is the
recommended Alpine 3 approach that guarantees the component factory is
available before Alpine processes x-data directives.

Changed x-data="giteaWorkspace()" to x-data="giteaWorkspace" (Alpine.data
calls the factory automatically, no parentheses needed).
This commit is contained in:
2026-07-16 14:12:53 -04:00
parent b141af886d
commit c990382085
+5 -3
View File
@@ -36,7 +36,8 @@
</style> </style>
<script> <script>
function giteaWorkspace() { document.addEventListener('alpine:init', () => {
Alpine.data('giteaWorkspace', () => {
const params = new URLSearchParams(window.location.search); const params = new URLSearchParams(window.location.search);
const owner = params.get('owner') || ''; const owner = params.get('owner') || '';
const repo = params.get('repo') || ''; const repo = params.get('repo') || '';
@@ -658,9 +659,10 @@ function giteaWorkspace() {
}); });
}, },
}; };
} });
});
</script> </script>
<div class="gw-main" x-data="giteaWorkspace()"> <div class="gw-main" x-data="giteaWorkspace">
<!-- File view --> <!-- File view -->
<div x-show="showFile && !showEditor" x-transition> <div x-show="showFile && !showEditor" x-transition>
<div class="gw-file-toolbar"> <div class="gw-file-toolbar">