Skip to content

Fix-1994 : Files keep loading when previewing all files in OneDrive #2001

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

NishkalankBezawada
Copy link
Contributor

@NishkalankBezawada NishkalankBezawada commented May 22, 2025

Q A
Bug fix? [x]
New feature? [ ]
New sample? [ ]
Related issues? fixes #1994

What's in this Pull Request?

Fix for the issue Files keep loading when previewing all files in OneDrive as mentioned in #1994

Issue

While using FilePicker control, When switching to the OneDrive tab in the FilePicker, it shows a loading spinner indefinitely and never displays the files. All other tabs in the FilePicker — such as Recent, Site, and Upload — work as expected and load properly.

Solution

(Root cause analysis was already done by the issue reporter)
The title of the documents library will vary if the system language is different other than English. For instance, The document library Title in English is as Documents where-in, in swedish it is Dokument.

By checking the default language as below,

  public isCurrentLanguageDefault(): boolean {
    return this.context.pageContext.cultureInfo.currentUICultureName === 'en-US';
  }

and having a conditional check as below,

      const isDefaultLang = this.isCurrentLanguageDefault();
      const myDocumentsLibrary = oneDriveLibsData.value[0];
      this.oneDrivePersonalLibraryTitle = isDefaultLang ? myDocumentsLibrary.Title : myDocumentsLibrary.EntityTypeName;
      this.oneDriveRootFolderRelativeUrl = `${myDocumentsLibrary.ParentWebUrl}/${isDefaultLang ? myDocumentsLibrary.Title : myDocumentsLibrary.EntityTypeName}`;
      this.oneDriveRootFolderAbsoluteUrl = `${this.oneDrivePersonalUrl}${isDefaultLang ? myDocumentsLibrary.Title : myDocumentsLibrary.EntityTypeName}`;

Resolves the issue.

Thanks,
Nish

@NishkalankBezawada NishkalankBezawada marked this pull request as ready for review May 22, 2025 17:52
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.

1 participant