Add animation to resetTo or immediatelyResetRouteStack in React Native? - animation

I've spent the better part of today looking for a solution to this. I have a login page that I don't want users to be able to navigate back to. To accomplish this, it's necessary to reset the route stack, removing the login page from the stack. While this can be accomplished with Navigator's resetTo(route) and immediatelyResetRouteStack(route) methods, these both cancel out the nice transition animation.
So, I after some vigorous Googling, I am back to StackOverflow to see if I can get some help. What I need is an animated transition between scenes, while resetting the route stack in the process.
I have seen this link, and the top answer wouldn't actually work. You don't have access the your instance of Navigator when inside the scope of the onDidFocus method, which only gets passed the route object. This means you can't call any of Navigator's methods from within that function.
If I do navigator.push(route), and then manually run navigator.immediatelyResetRouteStack(route) using a button, it does successfully reset the stack. This makes me think setTimeout is the solution, but that both seems like general bad practice / a cop-out.
I can't be the only one who's had this issue.

I got the same problem and I solved it with one workaround, the answer is in this other topic, here is the link: https://stackoverflow.com/a/38111701/1081603

Related

Yii2: Assign and remove items via ajax like in RBAC routes assignment

I need assistance. In Yii2 RBAC module, there is a part in the module when adding routes and removing them whereby it is done via selecting the routes and clicking on the button which moves them to the right, or remove button that moves them to the left via ajax. I have tried to search online but I guess I don't have the right description to help me get better results. I believe there must be an extension for achieving this. Below is the screenshot of what exactly I mean. I want to implement this in some part of my system but I don't know what to simply search on the internet so as to get the clue.
Any clue to what I should look for or an extension that will assist me achieve this is welcome.
You may try for this some of jquery plugins. Maybe this one http://loudev.com/ or https://github.com/crlcu/multiselect

Image disappears after routing in app

I'm having an issue that's probably not easy to diagnose so I'm going to describe the general issue I'm having.
I'm using a front-end router (page.js) to route around my app. Basically, whenever I route somewhere, I show components that should be shown for that route. The issue I'm having is that when I route to a specific route and then route back to where I was before (e.g. by clicking the "home" button and routing back to the homepage), my images are no longer displaying in their respective components. Here is an example:
Before I route away from my homepage, I have this image (svg) showing:
Then I route away to another view/component, and route back. Now my image is missing:
Upon inspecting dev tools:
Clearly the resource is present, but not showing.
This same thing happens to other images that should be showing in the component(s) that show with that route.
To test things out, I kept one component showing rather than hiding it on routing away from the current view, and sure enough the image was still showing when routing back to the original view that contained it and other components. The images in the other components were still missing.
Again I don't know what this problem would fall under so I hope to elicit some general advice as to what the problem could be.
Update. This issue also happens when using the back button. Perhaps it's related to the history state?
Without knowing exactly why this problem occurred, I have been able to fix the issue by using page.js in hashbang mode. I.e., I turned off the hashbang in the routing and it caused issues with finding public resources on popstate.

MVC 3/ASPNET Auth - Almost Randomly Redirecting To Account/LogOff

This is a very strange one for me and I've been battling with it for a while now. I really hope someone can help.
I have a fairly typical MVC 3 Website and I only seem to be getting this problem in IE and Firefox. Chrome plays along nicely. Lucky for me, the majority of our company's clients uses Chrome at the moment.
Problem is at a seemingly random point in time, the browser will automatically redirect me to the Account/LogOff action when I click on a link, and from there it will obviously go back to the Login page. This link will then continue with the same behavior.
I say "seemingly random" because today that link will work, tomorrow it won't and all other (or the majority - I have never had more than on problem link giving this problem at a time) links will be fine. Sometimes restarting the server/dev environment will take care of the problem, other times it won't. The browser will just keep redirecting to LogOff.
I have tried looking at the Referrer URL, but the controller/action being referred to will never be reached. (If I place a breakpoint in the action, it is missed and the next point reached would be the LogOff action)
If I look at the stacktrace when in the LogOff Action, I can't see any info from where the application has come from. I have also tried what was suggested in this page: Posting the Stack Trace on ASP.NET MVC, but I cannot see why I am being redirected to the LogOff action.
The only place I seem to be able to have a breakpoint get hit before hitting LogOff, is Application_BeginRequest in the Global.asax, but can't see where it is going from there on.
My guess is that somewhere along the line, ASPNET Auth decides the user isn't authenticated any more and redirects to the LogOff action. Problem is that the cookies associated with ASPNET Auth all still exist, have data in them and they haven't expired yet.
Anyway, I hope I have given enough info on the problem.
Thanks in advance.
[Edit]
OK, so I might have gotten a step closer. I came across this link and looked to see what is happening in my Application_AuthenticateRequest in my global.asax.
I am not quite sure why, by when I click on a link, Application_AuthenticateRequest gets accessed 3 times. When a link works (as in I can follow it and it doesn't log me out), the value of the .ASPAUTH cookie stays the same. I checked this by adding a breakpoint and a watch over
HttpContext.Current.Request.Cookies[".ASPXAUTH"].Value
When the link does not work, the first time the cookie has a value, then the other two times it is null. Thus, because the ASPXAUTH cookie is null, the system automatically redirects to the LogOut action.
If I consider the solution they posted in the link, I am not sure if this applies to me. As far as I can tell, the encrypted cookie is still small (as in a few hundred characters long) and not close to 4096 bytes. Also, I have only 3 cookies going at the time I when tested the broken link and I have a maximum of 5 cookies at any given time.
Any idea?
OK, so I had a hunch about cookies expiring. So I looked at whether there is a way to keep (force) cookies in Forms Authentication alive and that led me to http://www.codeproject.com/Articles/221889/How-to-Generate-Machine-Key-in-IIS7
The only way I could test this theory was to keep working and debugging the site as normal. (And that's why it took me so long to post this answer.) Since I introduced this solution it seems that the problem has been solved.
Interestingly I spoke an Architect the other day, with 20 years dev experience, about my problem. He looked at my code and is convinced this is a bug in the Forms Authentication code.
I hope this helps some people who are experiencing the same problem I have.

detect in rails if the user refresh the page

I am using rails 3.0 and ruby 1.8.7
How could detect if the user refresh the browser page?
I am coding a web wizard form, so I go to next step if all is valid. However if the user refresh the page i don't want go to next step.
Update
I put a hidden field (I know about session solution) which is updated when the user submit the form. My problem is that the form has many steps.
Any idea?. Excuse me
Thanks in advance
Actually server shouldn't know anything about client's state, that's what REST was designed for.
If you really need it, you can use the flash object in order to detect when user refresh page.
For this purpose you need that the entry point of the page will be a redirect_to, so it makes things a little bit complicated, but at least it will solve your problem.

Buddypress for wordpress Main Activity filtering AJAX

I am trying to wrap my head around how these are all connected. I am trying to add some functionality to my main activity AJAX query if a button is clicked. I see the _inc/ajax.php to edit and have looked through it, but not sure where to edit it to include new options or new loops.
As of now it seems I can find some of the features listed but I am getting stuck on how they get connected up specifically when creating my own new custom loops to be used. I created a update-loop.php and put this in my theme folder in a new directory called 'update' but can't seem to get it loaded up correctly.
All I want is to get the filtering option to filter new blog posts. (if possible new blog posts from a specific category, which looking through the available options and don't see it anywhere). Note I am NOT using wordpress Mu.
Thanks for any help or guidance, I have asked on the buddypress support forums (lost cause) but I never get any feedback or any peep out of any one there.
---------EDITED:
Let me clearly ask at least one question that would be very helpful in my knowledge and future development with buddypress in working using AJAX.
How can I/If possible create my own custom loops and use them within the ajax filtering options on the main activity wall?
Please any help would be greatly appreciated...
I don't know if you custom functionality is (seperate) plugin but take a look at this:
http://codex.wordpress.org/AJAX_in_Plugins
I'm afraid I don't understand what you are asking or what you want to do....

Resources