![]() ![]() For example, in Windows, I just click on the sound icon on the taskbar and then choose a master device from a drop-down list. By a simple way I mean something that my wife could do in a few clicks without messing with un-paring and pairing things again. I have a number of different bluetooth headphones paired with my Android tablet.Also I use wired loudspeaker connected to the sound jack on the tablet Is there a SIMPLE way to choose one of my sound devices at any particular moment. There may even be some security risks to this, given that the uid and activation token are being stored.Īlexander Gelbukh Asks: Android simple way to select system sound output device? My solution uses localstorage, which while effective, feels more hacky than necessary for the task at hand.I would be very grateful for any more informed explanation. I assume the stencil-router-v2 is responsible for the behaviour and probably has some built-in normalising hook for urls (perhaps for SEO reasons). Primarily, I find the initial behaviour of the url formatting to lowercase inexplicable and feel frustrated that I have not found any documentation that explain why this happens or how to prevent it.I have come up with one workaround, which I will share in case it is useful for others however I must disclaim that I dislike it for two reasons: Ideally, I would like to ensure that the url does not change at all, but failing that, can anyone think of any workarounds to store the encoded UID from the url on the first componentWillLoad() run, and then use that initial value in the form submission? So the issue is definitely that for some reason, sometime after the first componentWillLoad() (which should only run once) the url is forced to lowercase and the lifecycle methods start again. If I log it the first time componentWillLoad() runs, and then copy the encoded UID and decode it, it gives me the correct UID. I know that the encoding is correct as for a split second it appears correctly in the browser. URL path variables are extracted without the url reloading in lowercase.User follows link (which includes uid & token).Here is a partial of my stencil component: The componentWillLoad() runs again, extracts the now incorrect encoded UID, and submits it in the form and so the django backend fails to decode it and identify the user to activate. This is an issue as the encoded UID has now changed (djoser encoding is case sensitive). However, after literally a few milliseconds, the page reloads and the url has the same characters but is now lowercase. At this point, my componentWillLoad() lifecycle method extracts the encoded uid and the token from the url and stores it in the component state. The user to be activated is determined by the uid from the url once the backend has decoded it using `_uid(uid).Īfter opening the stencil page from the email link (baseUrl/users//, for a few milliseconds, the URL is perfect for my needs as the encoded uid is exactly as it was encoded by my django app (mixed case). When the form is submitted, the token from the url is used by the backend to authenticate the activation of the user's account.The user receives the email and clicks a button which takes them to a page on my stencil app where they (as an anonymous user) enter their password and name.The uid of the user is encoded using _uid(uid) and added to the url My django backend uses Djoser, Sendgrid and Anymail to send an email activation link to a user after their account is created.I am working on an account activation feature. This is a problem as the url contains an encoded UID so when it is forced to lowercase and then I extract the encoded uid, I can no longer decode in the backend. I cannot understand why when my stencil.js app loads, it runs the componentWillLoad() lifecycle method twice, and just before the second one forces the url to lowercase. Che Coelho Asks: Stencil.js: Unexpected URL behaviour - URL auto reloads to lowercase after a few milliseconds
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |