error message for sharepoint search, and minor style fix

This commit is contained in:
spencerwooo 2022-01-23 15:43:36 +08:00
parent 8e5135ea59
commit fad501a562
No known key found for this signature in database
GPG key ID: 24CD550268849CA0
3 changed files with 11 additions and 4 deletions

View file

@ -75,10 +75,10 @@ const Navbar = () => {
</div>
<div className="flex items-center space-x-1">
<div className="px-2 py-1 rounded-lg bg-gray-100 dark:bg-gray-700 font-medium text-xs">
<div className="px-2 py-1 rounded-lg bg-gray-200 dark:bg-gray-700 font-medium text-xs">
{os === 'mac' ? '⌘' : 'Ctrl'}
</div>
<div className="px-2 py-1 rounded-lg bg-gray-100 dark:bg-gray-700 font-medium text-xs">K</div>
<div className="px-2 py-1 rounded-lg bg-gray-200 dark:bg-gray-700 font-medium text-xs">K</div>
</div>
</button>

View file

@ -25,7 +25,14 @@ function useDriveItemSearch() {
// Map parentReference to the absolute path of the search result
data.map(item => {
item['path'] = `${mapAbsolutePath(item.parentReference.path)}/${encodeURIComponent(item.name)}`
// TODO: supporting sharepoint search where the path is not returned in parentReference
if ('path' in item.parentReference) {
item['path'] = `${mapAbsolutePath(item.parentReference.path)}/${encodeURIComponent(item.name)}`
} else {
throw Error(
'We currently only support search in OneDrive international. SharePoint instances are not supported yet. See issue: https://github.com/spencerwooo/onedrive-vercel-index/issues/299'
)
}
})
return data

View file

@ -91,7 +91,7 @@ export default function OAuthStep2() {
/>
<p className="py-1">The authorisation code extracted is:</p>
<p className="my-2 font-mono border border-gray-400/20 rounded text-sm bg-gray-50 dark:bg-gray-800 p-2 opacity-80">
<p className="my-2 font-mono border border-gray-400/20 rounded text-sm bg-gray-50 dark:bg-gray-800 p-2 opacity-80 truncate overflow-hidden">
{authCode || <span className="animate-pulse">Waiting for code...</span>}
</p>