1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

Merge pull request #7557 from turbo124/v5-develop

Prevent activating react app without it being installed.
This commit is contained in:
David Bomba 2022-06-16 16:54:34 +10:00 committed by GitHub
commit 98d969bf83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -163,6 +163,11 @@ class AccountController extends BaseController
public function update(UpdateAccountRequest $request, Account $account)
{
$fi = new \FilesystemIterator(public_path('react'), \FilesystemIterator::SKIP_DOTS);
if(iterator_count($fi) < 30)
return response()->json(['message' => 'React App Not Installed, Please install the React app before attempting to switch.'], 400);
$account->fill($request->all());
$account->save();

View File

@ -17,4 +17,15 @@
</body>
<!--
If you are reading this, there is a fair change that the react application has not loaded for you. There are a couple of solutions:
1. Download the release file from https://github.com/invoiceninja/invoiceninja and overwrite your current installation.
2. Switch back to the Flutter application by editing the database, you can do this with the following SQL
UPDATE accounts SET
set_react_as_default_ap = 0;
-->
</html>