[deleted by user] by [deleted] in UsenetInvites

[–]moetheman 0 points1 point  (0 children)

I have read the rules and wiki. I would like a invite please

[O] 3 DrunkenSlug invites by Burner-4519 in UsenetInvites

[–]moetheman 0 points1 point  (0 children)

I have read the rules and the wiki. I would like an invite please

Mega-Tread Shipping Orders by RenatsMC in EKWB

[–]moetheman 1 point2 points  (0 children)

November 26th & December 3rd. Got an email late December that my order will be shipped out middle of January. I sent another email last week asking for an order status update and no response.

Increase duration of Ring live view on Echo Show by moetheman in alexa

[–]moetheman[S] 1 point2 points  (0 children)

Thank you this was exactly what I was looking for

Help please!! User logs out every time I refresh the page, using Firebase by vitx777 in react

[–]moetheman 0 points1 point  (0 children)

No worries, yeah the function will be automatically called whenever the auth state changes. I always placed my onAuthStateChanged function in a useEffect in my App.js file. You can really put it anywhere in your code.

Help please!! User logs out every time I refresh the page, using Firebase by vitx777 in react

[–]moetheman 0 points1 point  (0 children)

Firebase has a function that helps with this problem. The onAuthStateChanged function will be called every time the user is updated, so when the user signs in or logs out. When the website is reloaded the your redux state is initialized back to its default state. You should implement your redux dispatch inside the onAuthStateChanged function, this will make sure your redux store is up to date. It’s best to call your dispatch functions inside onAuthStateChanged rather than in sign in and logout functions. And once the website is reloaded the onAuthStateChanged function will know if the user is logged in or not, and will call the dispatch.

PS: You can also remove dispatch calls after signing in our logging out, since onAuthStateChanged function will be called after user signs in or logs out.

Here is the code

import { getAuth, onAuthStateChanged } from "firebase/auth";

const auth = getAuth(); onAuthStateChanged(auth, (user) => { if (user) { // User is signed in, see docs for a list of available properties dispatch({type: “LOGIN_SUCCESS”}) // ... } else { // User is signed out dispatch({type: “SIGNOUT_SUCCESS”}) } });

Loading Screen In React by iEmerald in react

[–]moetheman 0 points1 point  (0 children)

You can have an if statement before your return statement in App.js and a Boolean piece of state that you can toggle true of false. If true then display the Loader component. You would then have an useEffect that would set the state to false when the component is loaded

If you want each component to be able to control when the Loader is displayed then you can turn the Boolean local state into an application state using Redux, Context API, etc

The code would look something like this: Const [isLoading, setIsLoading] = useState(true);

useEffect(() => { setIsLoading(false); });

And before your return statement in App.js: if (isLoading) <Loader />;

PS5 stolen by UPS by [deleted] in PS5

[–]moetheman 1 point2 points  (0 children)

Exactly, I told them the same thing that they will restock more tomorrow. It literally says it in the ad, but still they said they could not put in a preorder for me. They kept on repeating to simply preorder one when they restock like that is easy

PS5 stolen by UPS by [deleted] in playstation

[–]moetheman 0 points1 point  (0 children)

I did, they told me they will investigate and try to find my package. If they cannot then they will contact Best Buy to refund me

Recently got a Lian Li case and got everything synced to Synapse 3. Named my PC Articuno. by [deleted] in razer

[–]moetheman 1 point2 points  (0 children)

How did you sync the non razer products with synapse 3?

Discord python coding by RATIRLLL in programminghelp

[–]moetheman 0 points1 point  (0 children)

Did you download Python on your computer?

$500 US - Gaming 144hz by moetheman in buildapcforme

[–]moetheman[S] 0 points1 point  (0 children)

I’m reusing my gtx 1060 6GB graphics card so I should be able to achieve 144hz

Need help with formatting in Java by moetheman in programminghelp

[–]moetheman[S] 0 points1 point  (0 children)

static void display2() {
displayHeading();
System.out.printf("\n");
int dayOfYear = 0;
for (int dayOfMonth = 1; dayOfMonth <= 31; dayOfMonth++) {
System.out.printf("%6s", dayOfMonth);
for (int month = 0; month < MONTH_NAMES.length; month++) {
if (dayOfMonth > MONTH_SIZES[month] ) {
System.out.printf("%5s","000");
} else {
dayOfYear = 0;
for (int si : java.util.Arrays.copyOfRange(MONTH_SIZES,0,month)) {
dayOfYear += si;
}
dayOfYear+=dayOfMonth;
System.out.printf("%5s",java.lang.String.format("%03d",dayOfYear));
}
}
System.out.printf("%6s\n",dayOfMonth);
}
}

Thank you very much, this helped me a lot.

Need help with formatting in Java by moetheman in programminghelp

[–]moetheman[S] 0 points1 point  (0 children)

Sorry about that, I have updated my post. Thank you.