Restrict React Router for one time - reactjs

In my ReactJS project a link will be opened with some unique id .../connect/123456 By opening this user can have video call with someone. This is working but the problem is if copy the link and open in a new tab or new browser it still works. What I need is an error message says "Connection already made". How to achieve this?

You can solve this server side. Simply have a flag on your database that the call is already in progress. On the front-end side, simply fetch this flag from the database, if call is already in progress: then display the error message and redirect as necessary.

Related

How to close React.js PWA to apply updates?

We are developing a React.js PWA.Is it possible to programmatically close application after gets update to apply them?And how?Is there another solution for it??
You can not close the application, you are not allowed to close the tab opened by the user. Only tabs that have been opened with a code can be closed with a code.
This is your problem with killing Application in RAM(app cleaner).
This will clear the cache of the previous version of the application and replace it with the new main.chunk.js.
I have a solution that you can update the program without closing it, for doing this you can use the "clear-cache" React library.
close application after gets update to apply them
This in case of a web application would be killing the caches and refreshing the browser tab.
You can kill caches by applying something like versoning/time stamps/unique id etc to the resource URLs, so that on refresh browser detects them as a new resource that needs to be downloaded.
You can force refresh the app using location.reload();

How to refresh service worker when new update is pushed on server

I have a react app created by craco, it have service worker registered.
After pushing new build to server, user is still getting old data / build files as they are cached by service worker.
How can i force refresh the webpage, or give popup to user to refresh the page.
I tried using the existing code in onstatechange method which says -
New content is available and will be used when all tabs for this page are closed.
But this message pops up even if i change the state to offline.
Please suggest on how it can be achieved without forcing to close all tabs.

Oracle ADF - Redirect link is not working

I am developing a simple application using ADF comes with basic CRUD operations (create, read, update, delete). In this case, as you can see, I have dragged a link to the 1st column which is highlighted in yellow.
So whenever I deploy it and click that, it is supposed to redirect me to the Edit page where client will allow to make commit:
I did make sure the Action of link is associated with the Edit page (as highlighted in yellow above). However, the link wouldn't redirect me anywhere, no response.This is the unbounded task flow:
Okay so I have found out the solution. Due to the default setting, the application will be deployed on IE and this message will prompt out. As you can see, the message is mentioning about browser's compatibility. My IE is version 11.6, I'm not sure what's the issue here since my IE is kinda latest version but this message still pops out and affects the redirect link from working. However, simply copy the application URL to Google Chrome and run should fix this issue. Hope this helps in future.
If the two pages in the Unbounded Task Flow, then Add WildCard Control Flow Rule
and connect the two pages with the WildCard.
Or you can use the Popup instead of opening a new page for edit

AngulatJS + UI-Router: Connection check on page entry

I got a little Problem at the Moment:
Im building a new WebApp with different States. For this im using UI-Router.
Different States mean different URLs.
The Problem is the WebApp has to open a connection via Websocket to a server. If the connection is opened and the user navigate through the page there is no Problem. The Problem for me is the first "State" the user enters the WebApp.
Example URLs:
".../" -> open Connection -> State Home
".../#/Overview" -> open Connection -> State Overview
".../#/User/12" -> open Connection -> State User with resolve for User-Id 12
I hope you understand what I mean.
First i thought I do this with a resolve but then I thought okay i want the user to show the information"open Connection" during the process.
If I use mutiple resolves (my 3rd Example) it would also Display open Connection
So I need some "State" in the middle which Jumps in and then navigate to the state the user opened
Nobody has a answer?
Or is there maybe a way to initialize the page/App before UI-Router starts to work?
So before any States would Start the WebApp should open the connection and if it fails go to State "X" if not UI-Router should just do his normal job

Redirect after script was executed

I am really new in webprogramming and using angularJs and ionic to create an app.
Here is my problem, morelikeley my issue that I want to deal with the right way:
I have got a button which will exchange some data with my server and then link to an other website.
I am now wondering if it is the correct way to add an ng-clicked on my button which then runs a script that talks to my server and after that calls the next website by $location.path()?
Problem with this is, that it always throws an error saying:
Error: $location is not defined $scope.click#http://localhost:8100/scripts/controllers.js:17:9 $parseFunctionCall#http://localhost:8100/lib/angular/angular.js:12237:15 #http://localhost:8100>/lib/ionic/release/js/ionic-angular.js:7788:9 $RootScopeProvider/this.$get</Scope.prototype.$eval#http://localhost:8100/lib/angular/angular.js:14291:16 $RootScopeProvider/this.$get</Scope.prototype.$apply#http://localhost:8100/lib/angular/angular.js:14389:18 #http://localhost:8100/lib/ionic/release/js/ionic-angular.js:7787:7 jQuery.event.dispatch#http://localhost:8100/lib/jquery/dist/jquery.js:4408:15 jQuery.event.add/elemData.handle#http://localhost:8100/lib/jquery/dist/jquery.js:4095:6 triggerMouseEvent#http://localhost:8100/lib/ionic/release/js/ionic.js:2641:3 tapClick#http://localhost:8100/lib/ionic/release/js/ionic.js:2630:3 tapMouseUp#http://localhost:8100/lib/ionic/release/js/ionic.js:2700:5
My other idea is to set an href on the button which links to the next website, but then i cannot ensure that my script was executed successfully before redirecting, or is there a way to handle this?
Thanks!

Resources