fix: negative room quota

pull/75/head
sualko 2020-08-29 15:10:52 +02:00
parent 0ae21e0f1a
commit 3b4ee9e6aa
1 changed files with 2 additions and 1 deletions

View File

@ -108,6 +108,7 @@ const App: React.FC<Props> = () => {
} }
const maxRooms = restriction?.maxRooms || 0; const maxRooms = restriction?.maxRooms || 0;
const quota = maxRooms < 0 ? t('bbb', 'unlimited') : rooms.filter(room => room.userId === OC.currentUser).length + ' / ' + maxRooms;
return ( return (
<div id="bbb-react-root" <div id="bbb-react-root"
@ -154,7 +155,7 @@ const App: React.FC<Props> = () => {
</td> </td>
<td /> <td />
<td colSpan={3}> <td colSpan={3}>
<p className="text-muted">{t('bbb', 'Room quota:')} {rooms.filter(room => room.userId === OC.currentUser).length} / {maxRooms}</p> <p className="text-muted">{t('bbb', 'Room quota:')} {quota}</p>
</td> </td>
</tr> </tr>
</tfoot> </tfoot>