Skip to content

Commit

Permalink
Fix Bug 53524 - Client.Profile|List: User's display name with diacrit…
Browse files Browse the repository at this point in the history
…ics invalid
  • Loading branch information
AlexeySafronov committed Nov 9, 2021
1 parent 0b13f99 commit f5da850
Show file tree
Hide file tree
Showing 3 changed files with 1,161 additions and 1 deletion.
14 changes: 14 additions & 0 deletions packages/asc-web-common/api/people/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { request } from "../client";
//import axios from "axios";
import Filter from "./filter";
import * as fakePeople from "./fake";
import { Encoder } from "../../utils/encoder";

export function getUserList(filter = Filter.getDefault(), fake = false) {
if (fake) {
Expand All @@ -18,6 +19,14 @@ export function getUserList(filter = Filter.getDefault(), fake = false) {
return request({
method: "get",
url: `/people${params}`,
}).then((res) => {
res.items = res.items.map((user) => {
if (user && user.displayName) {
user.displayName = Encoder.htmlDecode(user.displayName);
}
return user;
});
return res;
});
}

Expand All @@ -26,6 +35,11 @@ export function getUser(userName = null) {
method: "get",
url: `/people/${userName || "@self"}.json`,
skipUnauthorized: true,
}).then((user) => {
if (user && user.displayName) {
user.displayName = Encoder.htmlDecode(user.displayName);
}
return user;
});
}
export function getUserPhoto(userId) {
Expand Down
1 change: 0 additions & 1 deletion packages/asc-web-common/store/UserStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class UserStore {

getCurrentUser = async () => {
const user = await api.people.getUser();

this.setUser(user);
};

Expand Down
Loading

0 comments on commit f5da850

Please sign in to comment.