Skip to content

Commit

Permalink
Fix redirection after switching instance
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-farre committed Dec 13, 2024
1 parent 8b337ce commit a10b092
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions controllers/MobileAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
namespace humhub\modules\fcmPush\controllers;

use humhub\components\Controller;
use humhub\libs\Html;
use humhub\modules\fcmPush\helpers\MobileAppHelper;
use Yii;

class MobileAppController extends Controller
{

public function actionInstanceOpener()
{
// Send to the mobile app to display the instance opener
Yii::$app->session->set(MobileAppHelper::SESSION_VAR_SHOW_OPENER, 1);

// Stay in the same page, for when we come back from the mobile app to this instance
return $this->refresh();
// Stay on the same page, because when we come back from the mobile app to this instance
// Force full page refresh to trigger the onLayoutAddonInit event
return $this->renderContent(sprintf(
'<script ' . Html::nonce() . '>window.location.href = "%s";</script>',
Yii::$app->request->referrer,
));
}

}

0 comments on commit a10b092

Please sign in to comment.