Skip to content

Commit cc42e5a

Browse files
committed
update content version actions display
1 parent 34fa439 commit cc42e5a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Livewire/ContentVersionHistory.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,18 @@ public function table(Table $table): Table
170170
return Gate::check('rollbackVersion', [$this->getOwnerRecord(), $record]);
171171
})
172172
->visible(function (Model | ContentVersion $record) {
173-
// Check 1 - Can visible if is allow rollback on current license
174173
if (! app(LicenseManager::class)->canRollbackVersion()) {
175174
return false;
176175
}
177176

178-
// Check 2 - Can visible if not a latest version
177+
return true;
178+
})
179+
->disabled(function (Model | ContentVersion $record) {
179180
if ($this->getCurrentContentVersion()?->getKey() === $record->getKey()) {
180-
return false;
181+
return true;
181182
}
182183

183-
return true;
184+
return false;
184185
})
185186
->action(function (Model | ContentVersion $record, TableAction $action) {
186187
try {

0 commit comments

Comments
 (0)