Skip to content

Commit

Permalink
fix: fixed browser/editor bucket fallback to host 'unknown'
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jul 18, 2022
1 parent cf2476c commit 9d4a638
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/stores/buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,23 @@ export const useBucketsStore = defineStore('buckets', {
// fallback to a bucket with 'unknown' host, if one exists.
// TODO: This needs a fix so we can get rid of this workaround.
const type = 'app.editor.activity';
return (host: string) =>
select_buckets(this.buckets, { host, type }) ||
select_buckets(this.buckets, { host: 'unknown', type });
return (host: string) => {
const buckets = select_buckets(this.buckets, { host, type });
return buckets.length == 0
? select_buckets(this.buckets, { host: 'unknown', type })
: buckets;
};
},
bucketsBrowser() {
// fallback to a bucket with 'unknown' host, if one exists.
// TODO: This needs a fix so we can get rid of this workaround.
const type = 'web.tab.current';
return (host: string) =>
select_buckets(this.buckets, { host, type }) ||
select_buckets(this.buckets, { host: 'unknown', type });
return (host: string) => {
const buckets = select_buckets(this.buckets, { host, type });
return buckets.length == 0
? select_buckets(this.buckets, { host: 'unknown', type })
: buckets;
};
},

getBucket() {
Expand Down

2 comments on commit 9d4a638

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are screenshots of this commit:

Screenshots using aw-server v0.12.0b2 (click to expand)

Screenshots using aw-server-rust master (click to expand)

CML watermark

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are screenshots of this commit:

Screenshots using aw-server v0.12.0b2 (click to expand)

Screenshots using aw-server-rust master (click to expand)

Screenshots using aw-server-rust v0.12.0b2 (click to expand)

CML watermark

Please sign in to comment.