Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistencies in the comments and some spaces #42

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DaniyelMe
Copy link
Contributor

These are inconsistencies in the comments, and missing spaces.

Copy link
Contributor

@DairAidarkhanov DairAidarkhanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great changes, but I disagree with some. Please, check the comments ✌

src/main.js Outdated
@@ -122,7 +122,7 @@ export default class Auth {
let data = await response.json();

// If the response returned an error, try to get a Firebase error code/message.
// Sometimes the error codes are joined with an explanation, we don't need that(its a bug).
// Sometimes the error codes are joined with an explanation, we don't need that (its a bug).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, "it's a bug" should be fixed too

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

src/main.js Outdated
return data;
});
}

/**
* Makes sure the user is signed-in and has up-to-date credentials.
* @throws Will throw if the user is not signed-in.
* Makes sure the user is logged in and has up-to-date credentials.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe logged in should be signed in everywhere? I long for "sign in" as this verb is used in the API.

src/main.js Outdated
* @param {boolean} [updateStorage = true] Check whether to update localStorage or not.
* Updates the user data in the localStorage.
* @param {Object} userData The new user data.
* @param {boolean} [updateStorage = true] Whether to update local storage or not.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check is essential here, otherwise the sentence is incomplete.

Also, I did not think about storage method can be replaced and may not be localStorage exclusively.

Maybe, "localStorage" should be replaced by "browser storage" in the comments?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lib is used by some outside of the browser, that's why I try to avoid using any other term.
And localStorage is the name of the storage we are currently using by default, so I think its OK to use.

As for "check". I think the change is OK.

src/main.js Outdated
* Sets up a function that will be called whenever the user state is changed.
* @param {function} callback Function to call when the event is triggered.
* @returns {function} The function that unsubscribes your callback after being called.
* Set up a function that will be called whenever the user state is changed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why removing s at the end of the "Set"?

@samuelgozi
Copy link
Owner

@DaniyelMe please look into some of the suggested changes made by @aidarkhanov.
Some of them I "thumbed-up" and are In my opinion needed changes.

src/main.js Outdated Show resolved Hide resolved
@DaniyelMe
Copy link
Contributor Author

@aidarkhanov can you please take a look to the changes/fixes I made.

Copy link
Contributor

@DairAidarkhanov DairAidarkhanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

But I realized, that "signed-in", "signed-out", "sign-in", "sign-out" should all be "signed in", "signed out", "sign in" and "sign out" as these are verbs. Therefore, dash there is incorrect.

Can you also fix all appearances of these verbs in the comments?

src/main.js Outdated
@@ -137,19 +137,19 @@ export default class Auth {
}

/**
* Makes sure the user is logged in and has up-to-date credentials.
* @throws Will throw if the user is not signed in.
* Makes sure the user is signed-in and has up-to-date credentials.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

But I realized, that "signed-in", "signed-out", "sign-in", "sign-out" should all be "signed in", "signed out", "sign in" and "sign out" as these are verbs. Therefore, dash there is incorrect.

Can you also fix all appearances of these verbs in the comments?

src/main.js Outdated
* @private
*/
async enforceAuth() {
if (!this.user) throw Error('The user must be logged-in to use this method.');
if (!this.user) throw Error('The user must be signed-in to use this method.');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@samuelgozi
Copy link
Owner

@DaniyelMe Take your time, but I think you should work on a different branch, and then make a pull request to master.
That might be what's causing the conflicts.

All of your changes show as conflicts, and the name of both branches is the same so it makes it a little difficult to resolve.

@DaniyelMe
Copy link
Contributor Author

@samuelgozi Sorry for the mess, I've fixed all the merge conflicts and @aidarkhanov great suggestions.
The complete fix is on another pull-request, here #43.

Please let me know if I missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants