fix: in dev mode do not ask confirmation on delete
This commit is contained in:
@@ -91,10 +91,12 @@ class Danger extends Component
|
|||||||
|
|
||||||
public function delete($password)
|
public function delete($password)
|
||||||
{
|
{
|
||||||
if (! Hash::check($password, Auth::user()->password)) {
|
if (isProduction()) {
|
||||||
$this->addError('password', 'The provided password is incorrect.');
|
if (! Hash::check($password, Auth::user()->password)) {
|
||||||
|
$this->addError('password', 'The provided password is incorrect.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $this->resource) {
|
if (! $this->resource) {
|
||||||
|
@@ -343,6 +343,11 @@ function isSubscribed()
|
|||||||
{
|
{
|
||||||
return isSubscriptionActive() || auth()->user()->isInstanceAdmin();
|
return isSubscriptionActive() || auth()->user()->isInstanceAdmin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isProduction(): bool
|
||||||
|
{
|
||||||
|
return ! isDev();
|
||||||
|
}
|
||||||
function isDev(): bool
|
function isDev(): bool
|
||||||
{
|
{
|
||||||
return config('app.env') === 'local';
|
return config('app.env') === 'local';
|
||||||
|
@@ -296,9 +296,16 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template x-if="step === 1">
|
<template x-if="step === 1">
|
||||||
<x-forms.button @click="step++" class="w-auto" isError>
|
@if(isDev())
|
||||||
<span x-text="step1ButtonText"></span>
|
<x-forms.button class="w-auto" isError
|
||||||
</x-forms.button>
|
@click="$wire.delete('hello')">
|
||||||
|
<span x-text="step3ButtonText"></span>
|
||||||
|
</x-forms.button>
|
||||||
|
@else
|
||||||
|
<x-forms.button @click="step++" class="w-auto" isError>
|
||||||
|
<span x-text="step1ButtonText"></span>
|
||||||
|
</x-forms.button>
|
||||||
|
@endif
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template x-if="step === 2">
|
<template x-if="step === 2">
|
||||||
|
Reference in New Issue
Block a user