Skip to content

Commit

Permalink
Added Tiptap Editor support
Browse files Browse the repository at this point in the history
  • Loading branch information
afsakar committed Nov 14, 2023
1 parent 08d8b4a commit 1b67c8a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Actions/TranslatableAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function (Field $component) {
->default((string) config('app.locale')),
])
->modalSubmitActionLabel(__('filament-translate-action::filament-translate-action.translate'))
->action(function (array $data) use ($component) {
->action(function (array $data, $livewire) use ($component) {
$googleTranslate = new GoogleTranslate();

$source = $data['source'] ?: (string) config('app.locale');
Expand All @@ -40,6 +40,12 @@ function (Field $component) {

try {
$component->state($googleTranslate);

$livewire->dispatch('refresh-tiptap-editors', [
'statePath' => $component->getName(),
'content' => $googleTranslate,
]);

Notification::make()
->title(__('filament-translate-action::filament-translate-action.success_title'))
->body(__('filament-translate-action::filament-translate-action.success_message'))
Expand Down

0 comments on commit 1b67c8a

Please sign in to comment.