Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • reactapp/src/Pages/Topic.js

    raf801e3 r3b6962d  
    2828} from "../Components/Styled/Modal.style";
    2929import axios from "../api/axios";
    30 import LoadingSpinner from "../Components/Styled/LoadingSpinner.style";
    3130
    3231const Topic = () => {
     
    4948
    5049  useEffect(() => {
    51     const url1 = `http://192.168.0.29:8080/public/thread/${params.topicId}`;
    52     const url2 = `http://192.168.0.29:8080/secure/currentUser`;
     50    const url1 = `http://192.168.0.19:8080/public/thread/${params.topicId}`;
     51    const url2 = `http://192.168.0.19:8080/secure/currentUser`;
    5352
    5453    const fetchTopic = async () => {
     
    10099    if (!replyContent.length < 1) {
    101100      const response = await axios(
    102         `http://192.168.0.29:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`,
     101        `http://192.168.0.19:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`,
    103102        {
    104103          method: "post",
     
    110109      );
    111110      setErrorMessage("");
    112       window.location.reload();
     111      window.location.reload(false);
    113112    } else {
    114113      setErrorMessage("Полето за содржина не смее да биде празно");
     
    129128    if (!postContent.length < 1) {
    130129      const response = await axios(
    131         `http://192.168.0.29:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`,
     130        `http://192.168.0.19:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`,
    132131        {
    133132          method: "post",
     
    139138      );
    140139      setErrorMessage("");
    141       window.location.reload();
     140      window.location.reload(false);
    142141    } else {
    143142      setErrorMessage("Полето за содржина не смее да биде празно");
     
    161160      ) {
    162161        const response = await axios(
    163           `http://192.168.0.29:8080/secure/upvoteThread/${post.postId}`,
     162          `http://192.168.0.19:8080/secure/upvoteThread/${post.postId}`,
    164163          {
    165164            method: "get",
     
    167166          }
    168167        );
    169         window.location.reload();
     168        window.location.reload(false);
    170169      } else {
    171170        return;
     
    184183      ) {
    185184        const response = await axios(
    186           `http://192.168.0.29:8080/secure/downvoteThread/${post.postId}`,
     185          `http://192.168.0.19:8080/secure/downvoteThread/${post.postId}`,
    187186          {
    188187            method: "get",
     
    191190        );
    192191
    193         window.location.reload();
     192        window.location.reload(false);
    194193      } else {
    195194        return;
     
    214213              {child.content}
    215214            </p>
    216             {new Date(child.timePosted).setMilliseconds(0) === new Date(child.timeLastEdited).setMilliseconds(0) ? (
     215            {thread.timePosted === thread.timeLastEdited ? (
    217216              <OpinionCardContentTime>
    218217                {dateConverter(
    219                   new Date(child.timePosted).toString().slice(4, -43)
    220                 )} <span style={{fontStyle:"normal",color:"blue"}}>#{child.postId}</span>
     218                  new Date(thread.timePosted).toString().slice(4, -43)
     219                )}
    221220              </OpinionCardContentTime>
    222221            ) : (
    223222              <OpinionCardContentTime>
    224223                {dateConverter(
    225                   new Date(child.timeLastEdited).toString().slice(4, -43)
    226                 )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{child.postId}</span>{" "}
     224                  new Date(thread.timeLastEdited).toString().slice(4, -43)
     225                )}{" "}
    227226                (едитирано од модератор)
    228227              </OpinionCardContentTime>
     
    271270              />
    272271
    273               <VoteCount right={10 + "px"}>
     272              <VoteCount right={50 + "px"}>
    274273                {child.votes.filter((v) => v.vote === "DOWNVOTE").length}
    275274              </VoteCount>
     
    325324      </CurrentPageNav>
    326325      <div style={{ height: "20px", marginBottom: "50px", marginTop: "50px" }}>
    327         <h3 style={{ float: "left" }}>{thread.title} <span style={{opacity:"50%", fontSize:"16px"}}>#{thread.postId}</span></h3>
     326        <h3 style={{ float: "left" }}>{thread.title}</h3>
    328327        {auth && (
    329328          <AddOpinionButton onClick={handleAddOpinionButtonClick}>
     
    370369            {thread.content}
    371370          </p>
    372           {new Date(thread.timePosted).setMilliseconds(0) === new Date(thread.timeLastEdited).setMilliseconds(0) ? (
     371          {thread.timePosted === thread.timeLastEdited ? (
    373372            <OpinionCardContentTime>
    374373              {dateConverter(
    375374                new Date(thread.timePosted).toString().slice(4, -43)
    376               )} <span style={{fontStyle:"normal",color:"blue"}}>#{thread.postId}</span>
     375              )}
    377376            </OpinionCardContentTime>
    378377          ) : (
     
    380379              {dateConverter(
    381380                new Date(thread.timeLastEdited).toString().slice(4, -43)
    382               )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{thread.postId}</span>{" "}
     381              )}{" "}
    383382              (едитирано од модератор)
    384383            </OpinionCardContentTime>
     
    445444                {directChild.content}
    446445              </p>
    447               {new Date(directChild.timePosted).setMilliseconds(0) === new Date(directChild.timeLastEdited).setMilliseconds(0) ? (
     446              {directChild.timePosted === directChild.timeLastEdited ? (
    448447                <OpinionCardContentTime>
    449448                  {dateConverter(
    450449                    new Date(directChild.timePosted).toString().slice(4, -43)
    451                   )} <span style={{fontStyle:"normal",color:"blue"}}>#{directChild.postId}</span>
     450                  )}
    452451                </OpinionCardContentTime>
    453452              ) : (
     
    457456                      .toString()
    458457                      .slice(4, -43)
    459                   )}{" "} <span style={{fontStyle:"normal",color:"blue"}}>#{directChild.postId}</span>{" "}
     458                  )}{" "}
    460459                  (едитирано од модератор)
    461460                </OpinionCardContentTime>
     
    560559  ) : !fetchError && !loadedThread ? (
    561560    <div>
    562       <LoadingSpinner style={{ marginTop: "140px" }}/>
     561      <p style={{ marginTop: "140px" }}>се вчитува...</p>
    563562      <Outlet />
    564563    </div>
Note: See TracChangeset for help on using the changeset viewer.