Commit 536ac012 authored by Ategon's avatar Ategon Committed by Grant
Browse files

Make mobile login able to be done instead of being blocked

parent d3f967e0
Loading
Loading
Loading
Loading
Loading
+7 −19
Original line number Diff line number Diff line
@@ -273,16 +273,8 @@ export const Palette = () => {
    [config.pallete.colors, cursor.color],
  );

  const mobileAccountName = user
    ? user.user.display_name || user.user.username || "User"
    : "Not logged in";
  const mobileAccountDetail = user
    ? user.service.instance.hostname
    : meta.isLoading
      ? "Loading..."
      : meta.data?.login === "INHIBIT"
        ? "Logging in is disabled"
        : "Click to log in";
  const mobileAccountName =
    user?.user.display_name || user?.user.username || "User";
  const mobileAccountInitial = user
    ? mobileAccountName.trim().charAt(0).toUpperCase() || "?"
    : "?";
@@ -682,7 +674,7 @@ export const Palette = () => {
      ? null
      : createPortal(
          <AnimatePresence>
            {isMobile && mobilePaletteOpen && (
            {isMobile && user && mobilePaletteOpen && (
              <motion.div
                key="mobile-palette-sheet-backdrop"
                animate={{ opacity: 1 }}
@@ -774,7 +766,7 @@ export const Palette = () => {
      ? null
      : createPortal(
          <AnimatePresence>
            {isMobile && mobileActionSheet && (
            {isMobile && user && mobileActionSheet && (
              <motion.div
                key="mobile-action-sheet-backdrop"
                animate={{ opacity: 1 }}
@@ -802,7 +794,7 @@ export const Palette = () => {
                        className="mobile-palette-avatar"
                        aria-hidden="true"
                      >
                        {user?.user.picture_url ? (
                        {user.user.picture_url ? (
                          <img src={user.user.picture_url} alt="" />
                        ) : (
                          <span>{mobileAccountInitial}</span>
@@ -810,14 +802,9 @@ export const Palette = () => {
                      </span>
                      <span className="mobile-action-sheet-account-copy">
                        <strong>{mobileAccountName}</strong>
                        {mobileAccountDetail && (
                          <span>{mobileAccountDetail}</span>
                        )}
                        <span>{user.service.instance.hostname}</span>
                      </span>
                    </div>
                    {!user &&
                      !meta.isLoading &&
                      meta.data?.login !== "INHIBIT" && <LoginButton />}
                    <button
                      type="button"
                      className="mobile-palette-icon-button"
@@ -1062,6 +1049,7 @@ export const Palette = () => {
              </span>
            </button>
          </div>
          {userOverlay}
        </motion.div>
      </>
    );