Limit community to single-user workspace
Deploy / deploy (push) Successful in 2m33s
CI / Rust Checks (push) Successful in 5m35s
CI / UI Checks (push) Successful in 5s
CI / Deployment Manifests (push) Successful in 2s
CI / Frontend E2E (push) Successful in 4m19s

This commit is contained in:
github-ops
2026-06-19 17:41:50 +00:00
parent ba29ac7b94
commit 58cfd86d90
23 changed files with 134 additions and 1696 deletions
+10 -23
View File
@@ -118,6 +118,10 @@ function renderWorkspaceList() {
var current = getCurrentWs();
updateWorkspaceHeader(current);
document.querySelectorAll('.ws-dropdown-footer').forEach(function(footer) {
footer.hidden = true;
});
var list = document.getElementById('ws-dropdown-list');
if (!list) return;
window.CrankDom.clear(list);
@@ -127,7 +131,8 @@ function renderWorkspaceList() {
var item = document.createElement('div');
item.className = 'ws-dropdown-item' + (active ? ' active' : '');
item.addEventListener('click', function() {
switchWorkspace(workspace.id);
var dd = document.getElementById('ws-dropdown');
if (dd) dd.hidden = true;
});
var dot = document.createElement('div');
@@ -232,28 +237,10 @@ function switchWorkspace(workspaceId) {
var dd = document.getElementById('ws-dropdown');
if (dd) dd.hidden = true;
if (!window.CrankApi || !window.CrankAuth || typeof window.CrankAuth.replaceSession !== 'function') {
cacheCurrentWorkspace(workspace);
renderWorkspaceList();
emitWorkspaceChange(workspace);
return;
}
return window.CrankApi
.setCurrentWorkspace(workspace.id)
.then(function(session) {
window.CrankAuth.replaceSession(session);
cacheCurrentWorkspace(workspace);
renderWorkspaceList();
emitWorkspaceChange(workspace);
return workspace;
})
.catch(function(error) {
if (window.CrankUi) {
window.CrankUi.error(error.message || tKey('workspace.switch_error'), tKey('workspace.switch_error_title'));
}
throw error;
});
cacheCurrentWorkspace(workspace);
renderWorkspaceList();
emitWorkspaceChange(workspace);
return Promise.resolve(workspace);
}
function setCurrentWorkspace(workspace) {