Skip to content

Commit

Permalink
Fixed bug causing the header switch to readonly mode
Browse files Browse the repository at this point in the history
  • Loading branch information
taifu9920 committed Sep 11, 2024
1 parent 1095ba9 commit a42247b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/multi-chat/resources/views/components/room/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-w
</div>
</div>
@endforeach
@elseif(!$readonly)
@else
@foreach ($llms as $bot)
@if (!App::environment('arena') && request()->user()->hasPerm('tab_Store'))
@php
Expand All @@ -55,17 +55,13 @@ class="absolute z-10 invisible inline-block px-3 py-2 text-sm font-medium text-w
'follow_base_bot_image' => is_null($bot->image),
]);
if (!request()->user()->hasPerm('Store_read_any_modelfile')) {
if ($bot_arr["owner_id"] != Auth::user()->id) {
$bot_arr["config"] = '';
if ($bot_arr['owner_id'] != Auth::user()->id) {
$bot_arr['config'] = '';
}
}
$bot_json = json_encode($bot_arr);
$readonly =
request()->user()->id == $bot->owner_id || request()->user()->hasPerm('tab_Manage')
? 'false'
: 'true';
@endphp
<div onclick="detail_update({{ $bot_json }}, {{ $readonly }})"
<div onclick="detail_update({{ $bot_json }}, {{ request()->user()->id == $bot->owner_id || request()->user()->hasPerm('tab_Manage') ? 'false' : 'true' }})"
data-modal-target="detail-modal" data-modal-toggle="detail-modal"
class="cursor-pointer mx-1 flex-shrink-0 h-10 w-10 rounded-full bg-black flex items-center justify-center overflow-hidden">
<img data-tooltip-target="llm_{{ $bot->id }}_chat" data-tooltip-placement="top"
Expand Down

0 comments on commit a42247b

Please sign in to comment.