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: profile page is not loading #19351

Merged
merged 1 commit into from Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -12,10 +12,10 @@ export default class UserStatusMessage extends Component {
return null;
}

return until(
this.status.ends_at,
this.currentUser.user_option.timezone,
this.currentUser.locale
);
const timezone = this.currentUser
? this.currentUser.timezone
: moment.tz.guess();

return until(this.status.ends_at, timezone, this.currentUser?.locale);
}
}
Expand Up @@ -141,4 +141,17 @@ module("Integration | Component | user-status-message", function (hooks) {
document.querySelector("[data-tippy-root] .user-status-message-tooltip")
);
});

test("doesn't blow up with an anonymous user", async function (assert) {
this.owner.unregister("service:current-user");
this.set("status", {
emoji: "tooth",
description: "off to dentist",
ends_at: "2100-02-02T12:30:00.000Z",
});

await render(hbs`<UserStatusMessage @status={{this.status}} />`);

assert.dom(".user-status-message").exists();
});
});