Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix clipboard storage behaviour (#1749) #1758

Merged
merged 1 commit into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion js/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@
$button.tooltip('hide');
}

// Load items from local storage in case activity
// in another tab has changed the content
this.items = JSON.parse(this.storage.getItem("clipboard"));

var type = $button.data('clipboard-type');
var slug = $button.data('clipboard-slug');
var index = this.items[type].indexOf(slug);
Expand Down Expand Up @@ -420,7 +424,7 @@
var actorsCount = this.items['actor'].length;
var reposCount = this.items['repository'].length;
var totalCount = iosCount + actorsCount + reposCount;

// Menu button count
var $buttonSpan = this.$menuButton.find('> span');
if (!$buttonSpan.length && totalCount > 0)
Expand Down
4 changes: 4 additions & 0 deletions plugins/arDominionB5Plugin/js/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ import Tooltip from "bootstrap/js/dist/tooltip";
event.preventDefault();
}

// Load items from local storage in case activity
// in another tab has changed the content
this.items = JSON.parse(this.storage.getItem("clipboard"));

var $button = $(event.target).closest("button");
var type = $button.data("clipboard-type");
var slug = $button.data("clipboard-slug");
Expand Down
Loading